ProblemDetailsResponseException Class
HAKOM.ErrorHandling.Http.Net.Api.Exceptions
Section titled “HAKOM.ErrorHandling.Http.Net.Api.Exceptions”Represents an exception reconstructed from an RFC 7807 problem-details HTTP response.
public sealed class ProblemDetailsResponseException : HAKOM.ErrorHandling.Core.Net.Api.HakomExceptionInheritance System.Object 🡒 System.Exception 🡒 HakomException 🡒 ProblemDetailsResponseException
Remarks
Section titled “Remarks”This exception is created on the client side when deserializing an error response
from a remote HAKOM service. It preserves the original HTTP status code, any extension
properties, and — if the original error was a HakomException — the HAKOM
error code. Nested inner exceptions are represented via the Root property of the
problem-details object.
This exception is identified by the error code of the original remote exception when available. Use TryGetHakomErrorCode(string) to retrieve it.
Properties
Section titled “Properties”ProblemDetailsResponseException.EquivalentHttpStatusCode Property
Section titled “ProblemDetailsResponseException.EquivalentHttpStatusCode Property”The status code of this error for an HTTP request is determined from the supplied error or problem details. If no status code can be determined, the default status code is 500 (Internal Server Error).
protected override System.Net.HttpStatusCode EquivalentHttpStatusCode { protected get; }Property Value
Section titled “Property Value”ProblemDetailsResponseException.Extensions Property
Section titled “ProblemDetailsResponseException.Extensions Property”Contains any properties included in the response that extend the problem-details object (see https://datatracker\.ietf\.org/doc/html/rfc7807\#section\-3\.2\)\.
public System.Collections.Generic.IDictionary<string,object?> Extensions { get; }Property Value
Section titled “Property Value”System.Collections.Generic.IDictionary<System.String,System.Object>
Methods
Section titled “Methods”ProblemDetailsResponseException.TryGetHakomErrorCode(string) Method
Section titled “ProblemDetailsResponseException.TryGetHakomErrorCode(string) Method”If the underlying exception appears to have been a HakomException, this method will return true and set code to the code as reported by the response.
public bool TryGetHakomErrorCode(out string code);Parameters
Section titled “Parameters”code System.String
If the method returns true, this parameter will contain the code representing the error that was raised by the service.
Returns
Section titled “Returns”System.Boolean
True if the response appears to have been caused by a HAKOM error, false if some other unexpected exception caused the error response.