Class representing an API error.
Creates an instance of APIError.
The error code.
The error message.
The Axios response associated with the error.
const error = new APIError(404, 'Not Found', response); Copy
const error = new APIError(404, 'Not Found', response);
Readonly
Optional
Static
Optional override for formatting stack traces
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Returns a string representation of the APIError.
A string describing the error.
const error = new APIError(404, 'Not Found', response);console.log(error.toString()); // "APIError(code=404): Not Found" Copy
const error = new APIError(404, 'Not Found', response);console.log(error.toString()); // "APIError(code=404): Not Found"
Create .stack property on a target object
Class representing an API error.