happy-waterline-errors
i want to be happy handling waterline errors
🚧 It is a bad idea to use this module! I made it to lessen my work! And it is not yet comprehensive! 🚧
usage:
; // formats errors from Waterline to make them more user-friendly// you can even send it back to your users as response! I do that!User
API:
;
happy(error [, options])
Formats waterline error
. You can provide options
.
options
(Object):key
(Function): function may be used to format attribute keys
errors:
validation errors:
code: "err_validation" status: 422 message: "validation failed" description: field: "email" rules: "email" field: "lastName" rules: "required" "string"
unknown errors:
code: "err_unknown" status: 500 message: "unknown error"
forbidden errors:
code: "err_forbidden" status: 403 message: "action is forbidden"
license:
The MIT License (MIT)
Copyright (c) 2015 GochoMugo mugo@forfuture.co.ke