Class ApiException
Thrown when the Seclai API returns a non-success HTTP status code. Contains the status code, HTTP method, request URL, and raw response body.
Implements
Inherited Members
Namespace: Seclai.Exceptions
Assembly: Seclai.dll
Syntax
public class ApiException : Exception, ISerializable
Constructors
ApiException(HttpStatusCode, string, Uri, string?)
Creates an ApiException from an API error response.
Declaration
public ApiException(HttpStatusCode statusCode, string method, Uri url, string? responseBody)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpStatusCode | statusCode | |
| string | method | |
| Uri | url | |
| string | responseBody |
Properties
Method
The HTTP method of the failed request (e.g. "GET", "POST").
Declaration
public string Method { get; }
Property Value
| Type | Description |
|---|---|
| string |
ResponseBody
The raw response body, if available.
Declaration
public string? ResponseBody { get; }
Property Value
| Type | Description |
|---|---|
| string |
StatusCode
The HTTP status code returned by the API.
Declaration
public HttpStatusCode StatusCode { get; }
Property Value
| Type | Description |
|---|---|
| HttpStatusCode |
Url
The request URL.
Declaration
public Uri Url { get; }
Property Value
| Type | Description |
|---|---|
| Uri |