@c8/errors
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -39,4 +39,8 @@ 'use strict' | ||
// Make err.data publicly available so we can send extra intel like custom error codes. | ||
// err.data can be filled in the last parameter of any Boom function. | ||
boomError.output.payload.params = boomError.data | ||
return boomError | ||
} | ||
} |
{ | ||
"name": "@c8/errors", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Common errors and their utils used by C8 management", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,19 @@ | ||
# errors | ||
Common error type in our applications | ||
# @c8/errors | ||
Common error type in our components | ||
## Usage | ||
- `npm i --save @c8/errors` | ||
- ```javascript | ||
const Errors = require('@c8/errors') | ||
// You will typically be fine just keeping the default mapping | ||
let boomErr = Errors.utils.toBoom(err) | ||
// But you can also specify the second parameter of toBoom() if I don't like the default mapping | ||
let boomErr = Errors.utils.toBoom(err, { | ||
entityTooLarge: ['FileTooLargeError'], | ||
unsupportedMediaType: ['TypeError'] | ||
}) | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4607
74
20