API Error
npm install @yo1dog/api-error
const {APIError} = require('@yo1dog/api-error');
new APIError(404, `Document with id '${id}' does not exist.`);
param | type | description |
---|---|---|
status |
number | Status code. |
message |
string | A human-readable description of the error. |
code |
string | Error code. |