IndiekitError
A custom error handler, IndiekitError, is available to plug-ins to return consistent and predictable error responses to Indiekit.
Syntax
js
import { IndiekitError } from "@indiekit/error";
throw new IndiekitError(message, options);Constructor
messageHuman readable error message. Required
optionsAn object used to customise the behaviour of the error.
cause- An error object containing the original error.
code- A string representing the internal error code.
plugin- A string representing the name of plug-in. Used to prefix error messages caused by a plug-in.
scope- A string representing an OAuth authentication scope.
status- A number representing an HTTP response status code.
uri- A string representing a URL to webpage providing information about the cause of the error and how to resolve it.