From 441f17548413353159a9662f75af05e400f9fc0b Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Wed, 14 Jun 2023 21:16:51 -0400 Subject: [PATCH] Added throws back into code --- .../Controllers/DORASummaryController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DevOpsMetrics.Service/Controllers/DORASummaryController.cs b/src/DevOpsMetrics.Service/Controllers/DORASummaryController.cs index 11820bfb..50c44f95 100644 --- a/src/DevOpsMetrics.Service/Controllers/DORASummaryController.cs +++ b/src/DevOpsMetrics.Service/Controllers/DORASummaryController.cs @@ -68,7 +68,7 @@ public async Task UpdateDORASummaryItem( //Instead of throwing exceptions when there are no secrets, add the error message to the overall processing message string errorMessage = null; if (isGitHub == true) - { + { //Get the client id and secret from the settings string clientIdName = PartitionKeys.CreateGitHubSettingsPartitionKeyClientId(owner, repo); string clientSecretName = PartitionKeys.CreateGitHubSettingsPartitionKeyClientSecret(owner, repo); @@ -77,6 +77,7 @@ public async Task UpdateDORASummaryItem( if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret)) { errorMessage = $"clientId '{clientId}' or clientSecret '{clientSecret}' not found in key vault"; + throw new Exception(errorMessage); } } else @@ -86,6 +87,7 @@ public async Task UpdateDORASummaryItem( if (string.IsNullOrEmpty(patToken)) { errorMessage = $"patToken '{patTokenName}' not found in key vault"; + throw new Exception(errorMessage); } }