exprs-error-handler
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

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

Package Sidebar

Install

npm i exprs-error-handler

Weekly Downloads

1

Version

0.0.6

License

MIT

Unpacked Size

6.75 kB

Total Files

15

Last publish

Collaborators

  • kentscientist