2.0.1 • Published 3 years ago
@yo1dog/api-error v2.0.1
api-error
API Error
npm install @yo1dog/api-error
Quick Start
const {APIError} = require('@yo1dog/api-error');
new APIError(404, `Document with id '${id}' does not exist.`);
Docs
new APIError(status, [message, [{code?, details?}]])
param | type | description |
---|---|---|
status | number | Status code. |
message | string | A human-readable description of the error. |
code | string | Error code. |