Skip to content

Commit

Permalink
Merge pull request #61 from The-Standard-Organization/users/aosunlana…
Browse files Browse the repository at this point in the history
…/coderub-httpexchange-abstractionadditionals

CODE RUB: HttpExchange V2.10.3 Abstraction Refinement
  • Loading branch information
glhays authored Aug 24, 2024
2 parents 42b1ad6 + 2a8ad28 commit 73843c7
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ private static async ValueTask<HttpExchange> TryCatch(
}
catch (InvalidHttpExchangeException invalidHttpExchangeException)
{
throw CreateHttpExchangeValidationException(
throw await CreateHttpExchangeValidationExceptionAsync(
exception: invalidHttpExchangeException);
}
catch (NullHttpExchangeRequestException nullHttpExchangeRequestException)
{
throw CreateHttpExchangeValidationException(
throw await CreateHttpExchangeValidationExceptionAsync(
exception: nullHttpExchangeRequestException);
}
catch (InvalidHttpExchangeRequestException invalidHttpExchangeRequestException)
{
throw CreateHttpExchangeValidationException(
throw await CreateHttpExchangeValidationExceptionAsync(
invalidHttpExchangeRequestException);
}
catch (InvalidHttpExchangeRequestHeaderException invalidHttpExchangeHeaderException)
{
throw CreateHttpExchangeValidationException(
throw await CreateHttpExchangeValidationExceptionAsync(
invalidHttpExchangeHeaderException);
}
catch (HttpRequestException httpRequestException)
Expand All @@ -49,7 +49,7 @@ private static async ValueTask<HttpExchange> TryCatch(
message: "Failed http request error occurred, contact support.",
innerException: httpRequestException);

throw CreateHttpExchangeDependencyException(
throw await CreateHttpExchangeDependencyExceptionAsync(
failedHttpExchangeRequestException);
}
catch (TaskCanceledException taskCanceledException)
Expand All @@ -59,7 +59,7 @@ private static async ValueTask<HttpExchange> TryCatch(
message: "Request timeout error occurred, please contact support.",
innerException: taskCanceledException);

throw CreateHttpExchangeDependencyException(
throw await CreateHttpExchangeDependencyExceptionAsync(
taskCanceledHttpExchangeException);
}
catch (ObjectDisposedException objectDisposedException)
Expand All @@ -69,7 +69,7 @@ private static async ValueTask<HttpExchange> TryCatch(
message: "Object already disposed error occurred, please fix errors and try again.",
innerException: objectDisposedException);

throw CreateHttpExchangeDependencyException(
throw await CreateHttpExchangeDependencyExceptionAsync(
objectDisposedHttpExchangeException);
}
catch (InvalidOperationException invalidOperationException)
Expand All @@ -79,7 +79,7 @@ private static async ValueTask<HttpExchange> TryCatch(
message: "Invalid http request operation error occurred, please contact support.",
innerException: invalidOperationException);

throw CreateHttpExchangeDependencyException(
throw await CreateHttpExchangeDependencyExceptionAsync(
invalidOperationHttpExchangeException);
}
catch (ArgumentException argumentException)
Expand All @@ -89,7 +89,7 @@ private static async ValueTask<HttpExchange> TryCatch(
message: "Invalid argument error occurred, contact support.",
innerException: argumentException);

throw CreateHttpExchangeDependencyException(
throw await CreateHttpExchangeDependencyExceptionAsync(
invalidArgumentHttpExchangeException);
}
catch (FormatException formatException)
Expand All @@ -99,7 +99,7 @@ private static async ValueTask<HttpExchange> TryCatch(
message: "Invalid format error occurred, contact support.",
innerException: formatException);

throw CreateHttpExchangeDependencyException(
throw await CreateHttpExchangeDependencyExceptionAsync(
invalidFormatHttpExchangeException);
}
catch (Exception serviceException)
Expand All @@ -109,28 +109,28 @@ private static async ValueTask<HttpExchange> TryCatch(
message: "Failed HttpExchange service error occurred, contact support.",
innerException: serviceException);

throw CreateHttpExchangeServiceException(
throw await CreateHttpExchangeServiceExceptionAsync(
failedHttpExchangeServiceException);
}
}

private static HttpExchangeValidationException CreateHttpExchangeValidationException(
private static async ValueTask<HttpExchangeValidationException> CreateHttpExchangeValidationExceptionAsync(
Xeption exception)
{
return new HttpExchangeValidationException(
message: "HttpExchange validation errors occurred, fix errors and try again.",
innerException: exception);
}

private static HttpExchangeDependencyException CreateHttpExchangeDependencyException(
private static async ValueTask<HttpExchangeDependencyException> CreateHttpExchangeDependencyExceptionAsync(
Xeption exception)
{
return new HttpExchangeDependencyException(
message: "HttpExchange dependency error occurred, contact support.",
innerException: exception);
}

private static HttpExchangeServiceException CreateHttpExchangeServiceException(
private static async ValueTask<HttpExchangeServiceException> CreateHttpExchangeServiceExceptionAsync(
Xeption exception)
{
return new HttpExchangeServiceException(
Expand Down
Loading

0 comments on commit 73843c7

Please sign in to comment.