Comparing version 2.4.2 to 2.5.0
@@ -236,3 +236,8 @@ // Load modules | ||
exports.badData = function (message, data) { | ||
return exports.create(422, message, data); | ||
}; | ||
// 5xx Server Errors | ||
@@ -239,0 +244,0 @@ |
{ | ||
"name": "boom", | ||
"description": "HTTP-friendly error objects", | ||
"version": "2.4.2", | ||
"repository": "git://github.com/spumko/boom", | ||
"version": "2.5.0", | ||
"repository": "git://github.com/hapijs/boom", | ||
"main": "index", | ||
@@ -26,5 +26,5 @@ "keywords": [ | ||
"type": "BSD", | ||
"url": "http://github.com/spumko/boom/raw/master/LICENSE" | ||
"url": "http://github.com/hapijs/boom/raw/master/LICENSE" | ||
} | ||
] | ||
} |
@@ -1,8 +0,9 @@ | ||
<a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a> | ||
![boom Logo](https://raw.github.com/spumko/boom/master/images/boom.png) | ||
![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png) | ||
HTTP-friendly error objects | ||
[![Build Status](https://secure.travis-ci.org/spumko/boom.png)](http://travis-ci.org/spumko/boom) | ||
[![Build Status](https://secure.travis-ci.org/hapijs/boom.png)](http://travis-ci.org/hapijs/boom) | ||
Lead Maintainer: [Eran Hammer](https://github.com/hueniverse) | ||
#List of friendly errors available | ||
@@ -180,2 +181,12 @@ | ||
###Boom.badData | ||
example payload for `Boom.badData('your message');` | ||
```json | ||
{ | ||
"statusCode": 422, | ||
"error": "Unprocessable Entity", | ||
"message": "your message" | ||
} | ||
``` | ||
###Boom.notImplemented | ||
@@ -182,0 +193,0 @@ example payload for `Boom.notImplemented('your message');` |
@@ -410,2 +410,18 @@ // Load modules | ||
describe('#badData', function () { | ||
it('returns a 422 error statusCode', function (done) { | ||
expect(Boom.badData().output.statusCode).to.equal(422); | ||
done(); | ||
}); | ||
it('sets the message with the passed in message', function (done) { | ||
expect(Boom.badData('my message').message).to.equal('my message'); | ||
done(); | ||
}); | ||
}); | ||
describe('#serverTimeout', function () { | ||
@@ -412,0 +428,0 @@ |
Sorry, the diff of this file is not supported yet
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
58617
550
240