IndiekitError
A custom error handler, IndiekitError
, is available to plug-ins to return consistent and predictable error responses to Indiekit.
js
import { IndiekitError } from "@indiekit/error";
throw new IndiekitError(message, options);
import { IndiekitError } from "@indiekit/error";
throw new IndiekitError(message, options);
Parameters | Type | Description |
---|---|---|
message | String | Human readable error message. Required. |
options.cause | Error | Original error. Optional. |
options.code | String | Error code. Optional. |
options.plugin | String | Name of plug-in. This is used to prefix any error messages caused by a plug-in. Optional. |
options.scope | String | OAuth authentication scope. Optional. |
options.status | Number | HTTP response status code. Optional. |
options.uri | String | URL to webpage providing information about the cause of the error and how to resolve it. Optional. |