Socket
Socket
Sign inDemoInstall

boom

Package Overview
Dependencies
Maintainers
3
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boom - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

6

lib/index.js

@@ -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 @@

2

package.json
{
"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:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc