fail-express
Fail-express is an express error-handler middleware for JSON APIs. This library uses http-status.
Example
const express = ;const failExpress = ; const app = ;const router = ; router; app; router;
API
const failExpress = ;
failExpress([options]);
Use the new fail-express middleware function using the given options
.
Options
fail-express accepts this properties in the options object.
errorReporter
Function that receives the error object with its default properties. Default fail-express error reporter:
const defaultErrorReporter = { console;};
displayStackTrace
Appends the error stack trace to the error object.
exposeAdditionalProperties
Appends additional properties to the error object.
Errors
Default properties:
message
type
name
code
status