@schornio/http-errors
v1.1.0
Published
Error classes for HTTP-error-codes (4xx, 5xx)
Downloads
1
Readme
HTTP errors
Error classes for HTTP-error-codes (4xx, 5xx)
Implemented errors
Generic errors
HttpError
4xx errors
- 400
BadRequestError
- 401
UnauthorizedError
- 403
ForbiddenError
- 404
NotFoundError
5xx errors
- 500
InternalServerError
- 501
NotImplementedError
Usage
Installation
npm install @schornio/http-errors
Example
var httpErrors = require('@schornio/http-errors');
var NotFoundError = httpErrors.NotFoundError;
throw new NotFoundError('Ressource not found');