http response error object for amk js
to install: npm i amk-error
to use:
const ErrorObject = require('amk-error');
throw new ErrorObject('Not found', 404);
Creating an error object
- message (string) - message regarding the error (default: Something went wrong)
- status (number) - http status code, will only accept 400 to 599. (default is 500)
- install dependencies using
npm install
- run
npm test
All bugs, feature requests, pull requests, feedback, etc., are welcome. Create an issue.