Skip to content

Class: EvalwrightApiError

The server answered, and the answer was a refusal. Branch on EvalwrightApiError.code, which is stable, rather than on the message.

Extends

  • Error

Constructors

Constructor

ts
new EvalwrightApiError(
   status, 
   code, 
   message, 
   details?
): EvalwrightApiError;

Parameters

status

number

HTTP status of the refusal.

code

string

Machine-readable code, e.g. VALIDATION_ERROR, UNAUTHORIZED.

message

string

details?

unknown

Extra context when the server can give it, e.g. the missing variable.

Returns

EvalwrightApiError

Overrides

ts
Error.constructor

Properties

cause?

ts
optional cause?: unknown;

Inherited from

ts
Error.cause

code

ts
readonly code: string;

Machine-readable code, e.g. VALIDATION_ERROR, UNAUTHORIZED.


details?

ts
readonly optional details?: unknown;

Extra context when the server can give it, e.g. the missing variable.


message

ts
message: string;

Inherited from

ts
Error.message

name

ts
name: string;

Inherited from

ts
Error.name

stack?

ts
optional stack?: string;

Inherited from

ts
Error.stack

status

ts
readonly status: number;

HTTP status of the refusal.

Released under the MIT licence.