Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.14 KB

error.md

File metadata and controls

40 lines (26 loc) · 1.14 KB

IndiekitError

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

Syntax

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

throw new IndiekitError(message, options);

Constructor

message : Human readable error message. Required

options : An 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.