Skip to content

WardrikError

An error response from the API.

  • Error
new WardrikError(
status,
error,
requestId?
): WardrikError;
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

WardrikError

Error.constructor
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.


readonly requestId: string | undefined;

The response's request-id. Quote it when asking for help.

static from(response): Promise<WardrikError>;

Reads the error from a failed response. Its type is unknown if the body isn't an error.

Parameter Type
response Response

Promise<WardrikError>