Comparing version
{ | ||
"name": "bounce", | ||
"description": "Selective error catching and rewrite rules", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"repository": "git://github.com/hapijs/bounce", | ||
@@ -15,2 +15,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"hoek": "5.x.x" | ||
}, | ||
@@ -17,0 +18,0 @@ "devDependencies": { |
@@ -11,3 +11,3 @@ # bounce | ||
Working with `async`/`await` introduces a new challange in handling errors. Unlike callbacks which | ||
Working with `async`/`await` introduces a new challange in handling errors. Unlike callbacks, which | ||
provide a dual machanism for passing application errors via the callback `err` argument and | ||
@@ -52,3 +52,3 @@ developer errors via exceptions, `await` combines these two channels into one. | ||
This will fail silently every time the user has a `name` becaue it is reassinging a value to a | ||
This will fail silently every time the user has a `name` because it is reassigning a value to a | ||
`const` variable. However, because `email()` errors are ignored, system errors are ignored as well. | ||
@@ -73,3 +73,3 @@ The idea is that `email()` can be used in both critical and non-critical paths. In the critical | ||
catch (err) { | ||
Bounce.rethrow(err, 'system'); // Rethrows system erros and ignores application errors | ||
Bounce.rethrow(err, 'system'); // Rethrows system errors and ignores application errors | ||
} | ||
@@ -96,3 +96,3 @@ | ||
- `decorate` - an object which is assigned to the `err`, copying the properties onto the error. | ||
- `override` - an error used to override `err` when it `err` matches. If used with `decorate`, | ||
- `override` - an error used to override `err` when `err` matches. If used with `decorate`, | ||
the `override` object is modified. | ||
@@ -99,0 +99,0 @@ - `return` - if `true`, the error is returned instead of thrown. Defaults to `false`. |
@@ -325,23 +325,2 @@ 'use strict'; | ||
describe('decorate()', () => { | ||
it('adds properties to error', () => { | ||
const orig = new Error('Something'); | ||
const properties = { x: 1, y: 'z' }; | ||
try { | ||
Bounce.decorate(orig, properties); | ||
} | ||
catch (err) { | ||
var error = err; | ||
} | ||
expect(error).to.shallow.equal(orig); | ||
expect(error).to.be.an.error('Something'); | ||
expect(error.x).to.equal(1); | ||
expect(error.y).to.equal('z'); | ||
}); | ||
}); | ||
describe('isBoom()', () => { | ||
@@ -348,0 +327,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%18524
-2.17%1
Infinity%378
-4.06%+ Added
+ Added