HAKOM.ErrorHandling.Http.Net.Api.Exceptions Namespace
Contains exception types specific to HTTP error handling in HAKOM web applications.
Remarks
Section titled “Remarks”All exceptions in this namespace inherit from HakomException and carry an System.Net.HttpStatusCode that determines the HTTP response status code when the exception is caught by the error-handling middleware.
Key exception types include:
- ExtraneousQueryParametersException — raised when a request contains query parameters not supported by the endpoint (HTTP 400).
- HttpRequestFailedException — abstract base class for exceptions indicating an HTTP request failure.
- ProblemDetailsResponseException — represents an error received as an RFC 7807 problem-details response from a remote service.
The ProblemDetailsResponseException is used on the client side when deserializing error
responses. It preserves the original HAKOM error code (if present) and supports nested inner exceptions
through the Root property of the problem-details object.
catch (ProblemDetailsResponseException ex){ if (ex.TryGetHakomErrorCode(out string code)) { logger.LogError("HAKOM error {Code}: {Message}", code, ex.Message); }}| Classes | |
|---|---|
| ExtraneousQueryParametersException | Indicates that a request was made to a resource with unsupported query parameters. |
| HttpRequestFailedException | Base class for exceptions indicating that an HTTP request failed. |
| ProblemDetailsResponseException | Represents an exception reconstructed from an RFC 7807 problem-details HTTP response. |
Was this page helpful?Thanks for your feedback!