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