Comparing version 4.0.0 to 4.1.0
@@ -223,2 +223,8 @@ 'use strict'; | ||
exports.paymentRequired = function (message, data) { | ||
return internals.create(402, message, data, exports.paymentRequired); | ||
}; | ||
exports.forbidden = function (message, data) { | ||
@@ -225,0 +231,0 @@ |
{ | ||
"name": "boom", | ||
"description": "HTTP-friendly error objects", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"repository": "git://github.com/hapijs/boom", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
@@ -19,2 +19,3 @@ ![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png) | ||
- [`Boom.unauthorized([message], [scheme], [attributes])`](#boomunauthorizedmessage-scheme-attributes) | ||
- [`Boom.paymentRequired([message], [data])`](#boompaymentrequiredmessage-data) | ||
- [`Boom.forbidden([message], [data])`](#boomforbiddenmessage-data) | ||
@@ -41,3 +42,3 @@ - [`Boom.notFound([message], [data])`](#boomnotfoundmessage-data) | ||
- [HTTP 5xx Errors](#http-5xx-errors) | ||
- [`Boom.badImplementation([message], [data])`](#boombadimplementationmessage-data) | ||
- [`Boom.badImplementation([message], [data])` - (*alias: `internal`*)](#boombadimplementationmessage-data---alias-internal) | ||
- [`Boom.notImplemented([message], [data])`](#boomnotimplementedmessage-data) | ||
@@ -196,2 +197,22 @@ - [`Boom.badGateway([message], [data])`](#boombadgatewaymessage-data) | ||
### `Boom.paymentRequired([message], [data])` | ||
Returns a 402 Payment Required error where: | ||
- `message` - optional message. | ||
- `data` - optional additional error data. | ||
```js | ||
Boom.paymentRequired('bandwidth used'); | ||
``` | ||
Generates the following response payload: | ||
```json | ||
{ | ||
"statusCode": 402, | ||
"error": "Payment Required", | ||
"message": "bandwidth used" | ||
} | ||
``` | ||
### `Boom.forbidden([message], [data])` | ||
@@ -599,3 +620,3 @@ | ||
### `Boom.badImplementation([message], [data])` | ||
### `Boom.badImplementation([message], [data])` - (*alias: `internal`*) | ||
@@ -602,0 +623,0 @@ Returns a 500 Internal Server Error error where: |
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
30631
264
723