loopback-common-errors
Little module for using the object Error as loopback uses them for returning error responses.
Example usage:
var errors = require;...
You have 5 prototyped common functions:
- badRequest(msg): returns status 400 and default message 'Bad Request'
- fobidden(msg): returns status 403 and default message 'Forbidden'
- notFound(msg): returns status 404 and default message 'Not Found'
- serverError(msg): returns status 500 and default message 'Internal Server Error'
- otherError(name, msg, status): returns an Error with fields passed as args