diff --git a/src/ApiService/ApiService/onefuzzlib/notifications/Ado.cs b/src/ApiService/ApiService/onefuzzlib/notifications/Ado.cs index 62ca828b98..1e34183ee4 100644 --- a/src/ApiService/ApiService/onefuzzlib/notifications/Ado.cs +++ b/src/ApiService/ApiService/onefuzzlib/notifications/Ado.cs @@ -72,8 +72,11 @@ public static async Async.Task Validate(AdoTemplate config) { try { connection = new VssConnection(config.BaseUrl, new VssBasicCredential(string.Empty, token.Value)); await connection.ConnectAsync(); - } catch { - return OneFuzzResultVoid.Error(ErrorCode.ADO_VALIDATION_INVALID_PAT, $"Failed to connect to {config.BaseUrl} using the provided token"); + } catch (Exception e) { + return OneFuzzResultVoid.Error(ErrorCode.ADO_VALIDATION_INVALID_PAT, new string[] { + $"Failed to connect to {config.BaseUrl} using the provided token", + $"Exception: {e}" + }); } } else { return OneFuzzResultVoid.Error(ErrorCode.ADO_VALIDATION_INVALID_PAT, "Auth token is missing or invalid"); @@ -98,8 +101,11 @@ public static async Async.Task Validate(AdoTemplate config) { } ); } - } catch { - return OneFuzzResultVoid.Error(ErrorCode.ADO_VALIDATION_INVALID_FIELDS, "Failed to query and compare the valid fields for this project"); + } catch (Exception e) { + return OneFuzzResultVoid.Error(ErrorCode.ADO_VALIDATION_INVALID_FIELDS, new string[] { + "Failed to query and compare the valid fields for this project", + $"Exception: {e}" + }); } return OneFuzzResultVoid.Ok; diff --git a/src/ApiService/ApiService/onefuzzlib/notifications/GithubIssues.cs b/src/ApiService/ApiService/onefuzzlib/notifications/GithubIssues.cs index 5c810f2351..b951a7f468 100644 --- a/src/ApiService/ApiService/onefuzzlib/notifications/GithubIssues.cs +++ b/src/ApiService/ApiService/onefuzzlib/notifications/GithubIssues.cs @@ -35,8 +35,11 @@ public static async Async.Task Validate(GithubIssuesTemplate try { gh = GetGitHubClient(auth.Value.User, auth.Value.PersonalAccessToken); var _ = await gh.User.Get(auth.Value.User); - } catch { - return OneFuzzResultVoid.Error(ErrorCode.GITHUB_VALIDATION_INVALID_PAT, $"Failed to login to github.com with user {auth.Value.User} and the provided Personal Access Token"); + } catch (Exception e) { + return OneFuzzResultVoid.Error(ErrorCode.GITHUB_VALIDATION_INVALID_PAT, new string[] { + $"Failed to login to github.com with user {auth.Value.User} and the provided Personal Access Token", + $"Exception: {e}" + }); } } else { return OneFuzzResultVoid.Error(ErrorCode.GITHUB_VALIDATION_INVALID_PAT, $"GithubAuth is missing or invalid"); @@ -44,8 +47,11 @@ public static async Async.Task Validate(GithubIssuesTemplate try { var _ = await gh.Repository.Get(config.Organization, config.Repository); - } catch { - return OneFuzzResultVoid.Error(ErrorCode.GITHUB_VALIDATION_INVALID_REPOSITORY, $"Failed to access repository: {config.Organization}/{config.Repository}"); + } catch (Exception e) { + return OneFuzzResultVoid.Error(ErrorCode.GITHUB_VALIDATION_INVALID_REPOSITORY, new string[] { + $"Failed to access repository: {config.Organization}/{config.Repository}", + $"Exception: {e}" + }); } return OneFuzzResultVoid.Ok;