WardrikError
An error response from the API.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WardrikError( status, error, requestId?): WardrikError;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
status |
number |
error |
{ type: | "invalid_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "not_supported" | "unavailable" | "internal" | "unknown"; message: string; } |
error.type |
| "invalid_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "not_supported" | "unavailable" | "internal" | "unknown" |
error.message |
string |
requestId? |
string |
Returns
Section titled “Returns”WardrikError
Overrides
Section titled “Overrides”Error.constructorProperties
Section titled “Properties”status
Section titled “status”readonly status: number;The HTTP status.
readonly type: | "invalid_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "not_supported" | "unavailable" | "internal" | "unknown";The error type, such as not_found or conflict.
requestId
Section titled “requestId”readonly requestId: string | undefined;The response's request-id. Quote it when asking for help.
Methods
Section titled “Methods”from()
Section titled “from()”static from(response): Promise<WardrikError>;Reads the error from a failed response. Its type is unknown if the body isn't an error.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
response |
Response |
Returns
Section titled “Returns”Promise<WardrikError>