1.0.11 • Published 7 years ago

ozylog-http-errors v1.0.11

Weekly downloads
16
License
SEE LICENSE IN LI...
Repository
github
Last release
7 years ago

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

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago