Class ApiValidationException
Thrown when the API returns HTTP 422 (Unprocessable Entity) with structured validation errors.
Implements
Inherited Members
Namespace: Seclai.Exceptions
Assembly: Seclai.dll
Syntax
public sealed class ApiValidationException : ApiException, ISerializable
Constructors
ApiValidationException(HttpStatusCode, string, Uri, string?, HttpValidationError?)
Creates an ApiValidationException with the parsed validation error details.
Declaration
public ApiValidationException(HttpStatusCode statusCode, string method, Uri url, string? responseBody, HttpValidationError? validation)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpStatusCode | statusCode | |
| string | method | |
| Uri | url | |
| string | responseBody | |
| HttpValidationError | validation |
Properties
Errors
Convenience accessor for the individual validation errors.
Declaration
public IReadOnlyList<ValidationError> Errors { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<ValidationError> |
Validation
The parsed validation error, if the response body could be deserialized.
Declaration
public HttpValidationError? Validation { get; }
Property Value
| Type | Description |
|---|---|
| HttpValidationError |