amkjs / amk-error

http response error object for amkjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AMK-ERROR

CircleCI codecov Known Vulnerabilities

http response error object for amk js

Usage

to install: npm i amk-error

to use:

const ErrorObject = require('amk-error');

throw new ErrorObject('Not found', 404);

API

constructor(message, status)


Creating an error object

Arguments
  • message (string) - message regarding the error (default: Something went wrong)
  • status (number) - http status code, will only accept 400 to 599. (default is 500)

Tests

  1. install dependencies using npm install
  2. run npm test

Feedback

All bugs, feature requests, pull requests, feedback, etc., are welcome. Create an issue.

License

MIT

About

http response error object for amkjs

License:MIT License


Languages

Language:JavaScript 100.0%