This package has been deprecated

Author message:

This package is no longer maintained. Please use @ozylog/http-errors instead.

ozylog-http-errors

1.0.11 • Public • Published

ozylog-http-errors

THIS MODULE IS NO LONGER MAINTAINED. Please use @ozylog/http-errors instead.

Create HTTP error objects

Travis npm

Installation

npm install ozylog-http-errors --save

List of errors

- BadRequestError([message = 'Bad Request'])
- ForbiddenError([message = 'Forbidden'])
- InternalServerError([message = 'Internal Server Error'])
- NotAcceptableError([message = 'Not Acceptable'])
- NotFoundError([message = 'Not Found'])
- NotImplementedError([message = 'Not Implemented'])
- UnauthorizedError([message = 'Unauthorized'])
- CreateError([message], [responseCode])

Usage Example

import {BadRequestError} from 'ozylog-http-errors';

export function validate(req, res, next) {
  if (!req.body.name) return next(new BadRequestError());
}

License

MIT

/ozylog-http-errors/

    Package Sidebar

    Install

    npm i ozylog-http-errors

    Weekly Downloads

    9

    Version

    1.0.11

    License

    SEE LICENSE IN LICENSE

    Last publish

    Collaborators