Comparing version 2.6.1 to 2.7.0
@@ -30,5 +30,6 @@ // Load modules | ||
Hoek.assert(!isNaN(parseFloat(statusCode)) && isFinite(statusCode) && statusCode >= 400, 'First argument must be a number (400+):', statusCode); | ||
Hoek.assert(Hoek.isInteger(statusCode) && statusCode >= 400, 'First argument must be a number (400+):', statusCode); | ||
error.isBoom = true; | ||
error.isServer = statusCode >= 500; | ||
@@ -35,0 +36,0 @@ if (!error.hasOwnProperty('data')) { |
{ | ||
"name": "boom", | ||
"description": "HTTP-friendly error objects", | ||
"version": "2.6.1", | ||
"version": "2.7.0", | ||
"repository": "git://github.com/hapijs/boom", | ||
@@ -22,3 +22,4 @@ "main": "index", | ||
"scripts": { | ||
"test": "make test-cov" | ||
"test": "lab -a code -t 100", | ||
"test-cov-html": "lab -a code -r html -o coverage.html" | ||
}, | ||
@@ -25,0 +26,0 @@ "licenses": [ |
@@ -12,2 +12,3 @@ ![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png) | ||
- `isBoom` - if `true`, indicates this is a `Boom` object instance. | ||
- `isServer` - convenience bool indicating status code >= 500. | ||
- `message` - the error message. | ||
@@ -457,3 +458,3 @@ - `output` - the formatted response. Can be directly manipulated after object construction to return a custom | ||
Returns a 422 Too Many Requests error where: | ||
Returns a 429 Too Many Requests error where: | ||
- `message` - optional message. | ||
@@ -460,0 +461,0 @@ - `data` - optional additional error data. |
@@ -98,2 +98,3 @@ // Load modules | ||
expect(error.output.payload.message).to.not.exist(); | ||
expect(error.isServer).to.be.false(); | ||
done(); | ||
@@ -130,3 +131,6 @@ }); | ||
expect(Boom.badRequest().output.statusCode).to.equal(400); | ||
var error = Boom.badRequest(); | ||
expect(error.output.statusCode).to.equal(400); | ||
expect(error.isServer).to.be.false(); | ||
done(); | ||
@@ -516,2 +520,3 @@ }); | ||
expect(err.message).to.equal('my message'); | ||
expect(err.isServer).to.true(); | ||
expect(err.output.payload.message).to.equal('An internal server error occurred'); | ||
@@ -535,2 +540,3 @@ done(); | ||
expect(boom.message).to.equal('Someting bad: Unexpected end of input'); | ||
expect(boom.isServer).to.be.true(); | ||
done(); | ||
@@ -594,4 +600,5 @@ } | ||
expect(err.isDeveloperError).to.equal(true); | ||
expect(err.isServer).to.be.true(); | ||
done(); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
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
66797
581
577
10