Error Handlers
Classes
- HttpClientError - Default Error which extends Error class
- Http404Error - Error to see if a resource is not found on the server, extends HttpClientError
- Http400Error - Error to see if a bad request is sent to server, extends HttpClientError
Usage
const { HttpClientError, Http400Error, Http404Error } = require('exprs-error-handler');
function x() {
throw new HttpClientError('Client');
}
function y() {
throw new Http400Error('400');
}
function z() {
throw new Http404Error('404');
}
try {
x();
y();
z();
} catch (e) {
console.log(e);
}
License
MIT © Kent Adrian Sato