1.0.11 • Published 8 years ago

ozylog-http-errors v1.0.11

Weekly downloads
16
License
SEE LICENSE IN LI...
Repository
github
Last release
8 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

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago