Skip to content


A custom error handler, IndiekitError, is available to plug-ins to return consistent and predictable error responses to Indiekit.

import { IndiekitError } from "@indiekit/error";

throw new IndiekitError(message, options);
messageStringHuman readable error message. Required.
options.causeErrorOriginal error. Optional.
options.codeStringError code. Optional.
options.pluginStringName of plug-in. This is used to prefix any error messages caused by a plug-in. Optional.
options.scopeStringOAuth authentication scope. Optional.
options.statusNumberHTTP response status code. Optional.
options.uriStringURL to webpage providing information about the cause of the error and how to resolve it. Optional.