mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
standardize some client ex msgs
This commit is contained in:
parent
b11ca36380
commit
4c5698472f
2 changed files with 5 additions and 4 deletions
|
|
@ -18,6 +18,7 @@ public interface IAgentGitHubClient
|
|||
|
||||
public class AgentGitHubClient : IAgentGitHubClient
|
||||
{
|
||||
private const string ExceptionMessageSuffix = " from the GitHub API.";
|
||||
private readonly GitHubClient _gitHubClient;
|
||||
private readonly GitHub _gitHubOptions;
|
||||
private readonly ILogger<AgentGitHubClient> _logger;
|
||||
|
|
@ -41,7 +42,7 @@ public async Task<IReadOnlyList<Issue>> GetAllIssues(RepositoryIssueRequest repo
|
|||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failed getting all Issues from the GitHub API.");
|
||||
_logger.LogError(ex, $"Failed getting all Issues{ExceptionMessageSuffix}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -55,7 +56,7 @@ public async Task<Issue> CreateIssue(NewIssue newIssue)
|
|||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failed creating Issue with the GitHub API.");
|
||||
_logger.LogError(ex, $"Failed creating Issue{ExceptionMessageSuffix}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,7 +70,7 @@ public async Task<Issue> UpdateIssue(int issueNumber, IssueUpdate issueUpdate)
|
|||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failed updating Issue with the GitHub API.");
|
||||
_logger.LogError(ex, $"Failed updating Issue{ExceptionMessageSuffix}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public interface IFilterListsApiClient
|
|||
public class FilterListsApiClient : IFilterListsApiClient
|
||||
{
|
||||
private const string FilterListsApiBaseUrl = "https://filterlists.com/api/v1";
|
||||
private const string ExceptionMessage = "Error retrieving response from FilterLists API.";
|
||||
private const string ExceptionMessage = "Error retrieving response from the FilterLists API.";
|
||||
private readonly IRestClient _restClient;
|
||||
|
||||
public FilterListsApiClient()
|
||||
|
|
|
|||
Loading…
Reference in a new issue