npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

npmdoc-boom

v0.0.4

Published

api documentation for [boom (v4.3.1)](https://github.com/hapijs/boom#readme) [![npm package](https://img.shields.io/npm/v/npmdoc-boom.svg?style=flat-square)](https://www.npmjs.org/package/npmdoc-boom) [![travis-ci.org build-status](https://api.travis-ci.o

Downloads

3

Readme

api documentation for boom (v4.3.1) npm package travis-ci.org build-status

HTTP-friendly error objects

NPM

apidoc

npmPackageListing

npmPackageDependencyTree

package.json


{
    "bugs": {
        "url": "https://github.com/hapijs/boom/issues"
    },
    "dependencies": {
        "hoek": "4.x.x"
    },
    "description": "HTTP-friendly error objects",
    "devDependencies": {
        "code": "4.x.x",
        "lab": "13.x.x",
        "markdown-toc": "0.12.x"
    },
    "directories": {},
    "dist": {
        "shasum": "4f8a3005cb4a7e3889f749030fd25b96e01d2e31",
        "tarball": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz"
    },
    "engines": {
        "node": ">=4.0.0"
    },
    "gitHead": "3d30c69faf6733a1604b400df71ed4781799a032",
    "homepage": "https://github.com/hapijs/boom#readme",
    "keywords": [
        "error",
        "http"
    ],
    "license": "BSD-3-Clause",
    "main": "lib/index.js",
    "maintainers": [
        {
            "name": "hueniverse"
        },
        {
            "name": "wyatt"
        },
        {
            "name": "arb"
        }
    ],
    "name": "boom",
    "optionalDependencies": {},
    "repository": {
        "type": "git",
        "url": "git://github.com/hapijs/boom.git"
    },
    "scripts": {
        "test": "lab -a code -t 100 -L -v",
        "test-cov-html": "lab -a code -r html -o coverage.html -L",
        "toc": "node generate-toc.js",
        "version": "npm run toc && git add README.md"
    },
    "version": "4.3.1"
}

table of contents

module boom

  1. function boom.badData (message, data)
  2. function boom.badGateway (message, data)
  3. function boom.badImplementation (message, data)
  4. function boom.badRequest (message, data)
  5. function boom.clientTimeout (message, data)
  6. function boom.conflict (message, data)
  7. function boom.create (statusCode, message, data)
  8. function boom.entityTooLarge (message, data)
  9. function boom.expectationFailed (message, data)
  10. function boom.forbidden (message, data)
  11. function boom.gatewayTimeout (message, data)
  12. function boom.illegal (message, data)
  13. function boom.internal (message, data, statusCode)
  14. function boom.lengthRequired (message, data)
  15. function boom.locked (message, data)
  16. function boom.methodNotAllowed (message, data, allow)
  17. function boom.notAcceptable (message, data)
  18. function boom.notFound (message, data)
  19. function boom.notImplemented (message, data)
  20. function boom.paymentRequired (message, data)
  21. function boom.preconditionFailed (message, data)
  22. function boom.preconditionRequired (message, data)
  23. function boom.proxyAuthRequired (message, data)
  24. function boom.rangeNotSatisfiable (message, data)
  25. function boom.resourceGone (message, data)
  26. function boom.serverUnavailable (message, data)
  27. function boom.teapot (message, data)
  28. function boom.tooManyRequests (message, data)
  29. function boom.unauthorized (message, scheme, attributes)
  30. function boom.unsupportedMediaType (message, data)
  31. function boom.uriTooLong (message, data)
  32. function boom.wrap (error, statusCode, message)

module boom

function boom.badData (message, data)

  • description and source-code
badData = function (message, data) {

    return internals.create(422, message, data, exports.badData);
}
  • example usage
...
  - ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
  - ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
  - ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
  - ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
  - ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
  - ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
  - ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
  - ['Boom.badData([message], [data])'](#boombaddatamessage-data)
  - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
  - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
  - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
  - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
- [HTTP 5xx Errors](#http-5xx-errors)
  - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
  - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
...

function boom.badGateway (message, data)

  • description and source-code
badGateway = function (message, data) {

    return internals.serverError(message, data, 502, exports.badGateway);
}
  • example usage
...
    - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
    - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
    - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
    - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
  - [HTTP 5xx Errors](#http-5xx-errors)
    - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
    - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
    - ['Boom.badGateway([message], [data])'](#boombadgatewaymessage-data)
    - ['Boom.serverUnavailable([message], [data])'](#boomserverunavailablemessage-data)
    - ['Boom.gatewayTimeout([message], [data])'](#boomgatewaytimeoutmessage-data)
  - [F.A.Q.](#faq)

<!-- tocstop -->

# Boom
...

function boom.badImplementation (message, data)

  • description and source-code
badImplementation = function (message, data) {

    const err = internals.serverError(message, data, 500, exports.badImplementation);
    err.isDeveloperError = true;
    return err;
}
  • example usage
...
    - ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
    - ['Boom.badData([message], [data])'](#boombaddatamessage-data)
    - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
    - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
    - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
    - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
  - [HTTP 5xx Errors](#http-5xx-errors)
    - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
    - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
    - ['Boom.badGateway([message], [data])'](#boombadgatewaymessage-data)
    - ['Boom.serverUnavailable([message], [data])'](#boomserverunavailablemessage-data)
    - ['Boom.gatewayTimeout([message], [data])'](#boomgatewaytimeoutmessage-data)
  - [F.A.Q.](#faq)

<!-- tocstop -->
...

function boom.badRequest (message, data)

  • description and source-code
badRequest = function (message, data) {

    return internals.create(400, message, data, exports.badRequest);
}
  • example usage
...
<!-- toc -->

- [Boom](#boom)
- [Helper Methods](#helper-methods)
  - ['wrap(error, [statusCode], [message])'](#wraperror-statuscode-message)
  - ['create(statusCode, [message], [data])'](#createstatuscode-message-data)
- [HTTP 4xx Errors](#http-4xx-errors)
  - ['Boom.badRequest([message], [data])'](#boombadrequestmessage-data)
  - ['Boom.unauthorized([message], [scheme], [attributes])'](#boomunauthorizedmessage-scheme-attributes)
  - ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
  - ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
  - ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
  - ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
  - ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
  - ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
...

function boom.clientTimeout (message, data)

  • description and source-code
clientTimeout = function (message, data) {

    return internals.create(408, message, data, exports.clientTimeout);
}
  • example usage
...
- ['Boom.unauthorized([message], [scheme], [attributes])'](#boomunauthorizedmessage-scheme-attributes)
- ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
- ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
- ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
- ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
- ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
- ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
- ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
...

function boom.conflict (message, data)

  • description and source-code
conflict = function (message, data) {

    return internals.create(409, message, data, exports.conflict);
}
  • example usage
...
- ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
- ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
- ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
- ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
- ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
- ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
- ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
- ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
...

function boom.create (statusCode, message, data)

  • description and source-code
create = function (statusCode, message, data) {

    return internals.create(statusCode, message, data, exports.create);
}
  • example usage
...

Generates an 'Error' object with the **boom** decorations where:
- 'statusCode' - an HTTP error code number. Must be greater or equal 400.
- 'message' - optional message string.
- 'data' - additional error data set to 'error.data' property.

'''js
var error = Boom.create(400, 'Bad request', { timestamp: Date.now() });
'''

## HTTP 4xx Errors

### 'Boom.badRequest([message], [data])'

Returns a 400 Bad Request error where:
...

function boom.entityTooLarge (message, data)

  • description and source-code
entityTooLarge = function (message, data) {

    return internals.create(413, message, data, exports.entityTooLarge);
}
  • example usage
...
- ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
- ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
- ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
- ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
- ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
- ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
- ['Boom.badData([message], [data])'](#boombaddatamessage-data)
- ['Boom.locked([message], [data])'](#boomlockedmessage-data)
...

function boom.expectationFailed (message, data)

  • description and source-code
expectationFailed = function (message, data) {

    return internals.create(417, message, data, exports.expectationFailed);
}
  • example usage
...
  - ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
  - ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
  - ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
  - ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
  - ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
  - ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
  - ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
  - ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
  - ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
  - ['Boom.badData([message], [data])'](#boombaddatamessage-data)
  - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
  - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
  - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
  - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
- [HTTP 5xx Errors](#http-5xx-errors)
...

function boom.forbidden (message, data)

  • description and source-code
forbidden = function (message, data) {

    return internals.create(403, message, data, exports.forbidden);
}
  • example usage
...
- [Helper Methods](#helper-methods)
  - ['wrap(error, [statusCode], [message])'](#wraperror-statuscode-message)
  - ['create(statusCode, [message], [data])'](#createstatuscode-message-data)
- [HTTP 4xx Errors](#http-4xx-errors)
  - ['Boom.badRequest([message], [data])'](#boombadrequestmessage-data)
  - ['Boom.unauthorized([message], [scheme], [attributes])'](#boomunauthorizedmessage-scheme-attributes)
  - ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
  - ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
  - ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
  - ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
  - ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
  - ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
  - ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
  - ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
  - ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
...

function boom.gatewayTimeout (message, data)

  • description and source-code
gatewayTimeout = function (message, data) {

    return internals.serverError(message, data, 504, exports.gatewayTimeout);
}
  • example usage
...
    - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
    - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
  - [HTTP 5xx Errors](#http-5xx-errors)
    - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
    - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
    - ['Boom.badGateway([message], [data])'](#boombadgatewaymessage-data)
    - ['Boom.serverUnavailable([message], [data])'](#boomserverunavailablemessage-data)
    - ['Boom.gatewayTimeout([message], [data])'](#boomgatewaytimeoutmessage-data)
  - [F.A.Q.](#faq)

<!-- tocstop -->

# Boom

**boom** provides a set of utilities for returning HTTP errors. Each utility returns a 'Boom' error response
...

function boom.illegal (message, data)

  • description and source-code
illegal = function (message, data) {

    return internals.create(451, message, data, exports.illegal);
}
  • example usage
...
  - ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
  - ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
  - ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
  - ['Boom.badData([message], [data])'](#boombaddatamessage-data)
  - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
  - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
  - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
  - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
- [HTTP 5xx Errors](#http-5xx-errors)
  - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
  - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
  - ['Boom.badGateway([message], [data])'](#boombadgatewaymessage-data)
  - ['Boom.serverUnavailable([message], [data])'](#boomserverunavailablemessage-data)
  - ['Boom.gatewayTimeout([message], [data])'](#boomgatewaytimeoutmessage-data)
- [F.A.Q.](#faq)
...

function boom.internal (message, data, statusCode)

  • description and source-code
internal = function (message, data, statusCode) {

    return internals.serverError(message, data, statusCode, exports.internal);
}
  • example usage
n/a

function boom.lengthRequired (message, data)

  • description and source-code
lengthRequired = function (message, data) {

    return internals.create(411, message, data, exports.lengthRequired);
}
  • example usage
...
- ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
- ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
- ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
- ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
- ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
- ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
- ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
- ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
...

function boom.locked (message, data)

  • description and source-code
locked = function (message, data) {

    return internals.create(423, message, data, exports.locked);
}
  • example usage
...
  - ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
  - ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
  - ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
  - ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
  - ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
  - ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
  - ['Boom.badData([message], [data])'](#boombaddatamessage-data)
  - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
  - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
  - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
  - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
- [HTTP 5xx Errors](#http-5xx-errors)
  - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
  - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
  - ['Boom.badGateway([message], [data])'](#boombadgatewaymessage-data)
...

function boom.methodNotAllowed (message, data, allow)

  • description and source-code
methodNotAllowed = function (message, data, allow) {

    const err = internals.create(405, message, data, exports.methodNotAllowed);

    if (typeof allow === 'string') {
        allow = [allow];
    }

    if (Array.isArray(allow)) {
        err.output.headers.Allow = allow.join(', ');
    }

    return err;
}
  • example usage
...
  - ['create(statusCode, [message], [data])'](#createstatuscode-message-data)
- [HTTP 4xx Errors](#http-4xx-errors)
  - ['Boom.badRequest([message], [data])'](#boombadrequestmessage-data)
  - ['Boom.unauthorized([message], [scheme], [attributes])'](#boomunauthorizedmessage-scheme-attributes)
  - ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
  - ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
  - ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
  - ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
  - ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
  - ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
  - ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
  - ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
  - ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
  - ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
  - ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
...

function boom.notAcceptable (message, data)

  • description and source-code
notAcceptable = function (message, data) {

    return internals.create(406, message, data, exports.notAcceptable);
}
  • example usage
...
  - [HTTP 4xx Errors](#http-4xx-errors)
- ['Boom.badRequest([message], [data])'](#boombadrequestmessage-data)
- ['Boom.unauthorized([message], [scheme], [attributes])'](#boomunauthorizedmessage-scheme-attributes)
- ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
- ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
- ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
- ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
- ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
- ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
...

function boom.notFound (message, data)

  • description and source-code
notFound = function (message, data) {

    return internals.create(404, message, data, exports.notFound);
}
  • example usage
...
  - ['wrap(error, [statusCode], [message])'](#wraperror-statuscode-message)
  - ['create(statusCode, [message], [data])'](#createstatuscode-message-data)
- [HTTP 4xx Errors](#http-4xx-errors)
  - ['Boom.badRequest([message], [data])'](#boombadrequestmessage-data)
  - ['Boom.unauthorized([message], [scheme], [attributes])'](#boomunauthorizedmessage-scheme-attributes)
  - ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
  - ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
  - ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
  - ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
  - ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
  - ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
  - ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
  - ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
  - ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
  - ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
...

function boom.notImplemented (message, data)

  • description and source-code
notImplemented = function (message, data) {

    return internals.serverError(message, data, 501, exports.notImplemented);
}
  • example usage
...
    - ['Boom.badData([message], [data])'](#boombaddatamessage-data)
    - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
    - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
    - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
    - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
  - [HTTP 5xx Errors](#http-5xx-errors)
    - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
    - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
    - ['Boom.badGateway([message], [data])'](#boombadgatewaymessage-data)
    - ['Boom.serverUnavailable([message], [data])'](#boomserverunavailablemessage-data)
    - ['Boom.gatewayTimeout([message], [data])'](#boomgatewaytimeoutmessage-data)
  - [F.A.Q.](#faq)

<!-- tocstop -->
...

function boom.paymentRequired (message, data)

  • description and source-code
paymentRequired = function (message, data) {

    return internals.create(402, message, data, exports.paymentRequired);
}
  • example usage
...
- [Boom](#boom)
- [Helper Methods](#helper-methods)
  - ['wrap(error, [statusCode], [message])'](#wraperror-statuscode-message)
  - ['create(statusCode, [message], [data])'](#createstatuscode-message-data)
- [HTTP 4xx Errors](#http-4xx-errors)
  - ['Boom.badRequest([message], [data])'](#boombadrequestmessage-data)
  - ['Boom.unauthorized([message], [scheme], [attributes])'](#boomunauthorizedmessage-scheme-attributes)
  - ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
  - ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
  - ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
  - ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
  - ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
  - ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
  - ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
  - ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
...

function boom.preconditionFailed (message, data)

  • description and source-code
preconditionFailed = function (message, data) {

    return internals.create(412, message, data, exports.preconditionFailed);
}
  • example usage
...
- ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
- ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
- ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
- ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
- ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
- ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
- ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
- ['Boom.badData([message], [data])'](#boombaddatamessage-data)
...

function boom.preconditionRequired (message, data)

  • description and source-code
preconditionRequired = function (message, data) {

    return internals.create(428, message, data, exports.preconditionRequired);
}
  • example usage
...
  - ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
  - ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
  - ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
  - ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
  - ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
  - ['Boom.badData([message], [data])'](#boombaddatamessage-data)
  - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
  - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
  - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
  - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
- [HTTP 5xx Errors](#http-5xx-errors)
  - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
  - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
  - ['Boom.badGateway([message], [data])'](#boombadgatewaymessage-data)
  - ['Boom.serverUnavailable([message], [data])'](#boomserverunavailablemessage-data)
...

function boom.proxyAuthRequired (message, data)

  • description and source-code
proxyAuthRequired = function (message, data) {

    return internals.create(407, message, data, exports.proxyAuthRequired);
}
  • example usage
...
- ['Boom.badRequest([message], [data])'](#boombadrequestmessage-data)
- ['Boom.unauthorized([message], [scheme], [attributes])'](#boomunauthorizedmessage-scheme-attributes)
- ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
- ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
- ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
- ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
- ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
- ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
...

function boom.rangeNotSatisfiable (message, data)

  • description and source-code
rangeNotSatisfiable = function (message, data) {

    return internals.create(416, message, data, exports.rangeNotSatisfiable);
}
  • example usage
...
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
- ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
- ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
- ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
- ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
- ['Boom.badData([message], [data])'](#boombaddatamessage-data)
- ['Boom.locked([message], [data])'](#boomlockedmessage-data)
- ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
- ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
- ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
...

function boom.resourceGone (message, data)

  • description and source-code
resourceGone = function (message, data) {

    return internals.create(410, message, data, exports.resourceGone);
}
  • example usage
...
- ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
- ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
- ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
- ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
- ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
- ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
- ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
- ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
...

function boom.serverUnavailable (message, data)

  • description and source-code
serverUnavailable = function (message, data) {

    return internals.serverError(message, data, 503, exports.serverUnavailable);
}
  • example usage
...
    - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
    - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
    - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
  - [HTTP 5xx Errors](#http-5xx-errors)
    - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
    - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
    - ['Boom.badGateway([message], [data])'](#boombadgatewaymessage-data)
    - ['Boom.serverUnavailable([message], [data])'](#boomserverunavailablemessage-data)
    - ['Boom.gatewayTimeout([message], [data])'](#boomgatewaytimeoutmessage-data)
  - [F.A.Q.](#faq)

<!-- tocstop -->

# Boom
...

function boom.teapot (message, data)

  • description and source-code
teapot = function (message, data) {

    return internals.create(418, message, data, exports.teapot);
}
  • example usage
...
  - ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
  - ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
  - ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
  - ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
  - ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
  - ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
  - ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
  - ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
  - ['Boom.badData([message], [data])'](#boombaddatamessage-data)
  - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
  - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
  - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
  - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
- [HTTP 5xx Errors](#http-5xx-errors)
  - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
...

function boom.tooManyRequests (message, data)

  • description and source-code
tooManyRequests = function (message, data) {

    return internals.create(429, message, data, exports.tooManyRequests);
}
  • example usage
...
  - ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
  - ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
  - ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
  - ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
  - ['Boom.badData([message], [data])'](#boombaddatamessage-data)
  - ['Boom.locked([message], [data])'](#boomlockedmessage-data)
  - ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
  - ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
  - ['Boom.illegal([message], [data])'](#boomillegalmessage-data)
- [HTTP 5xx Errors](#http-5xx-errors)
  - ['Boom.badImplementation([message], [data])' - (*alias: 'internal'*)](#boombadimplementationmessage-data---alias-internal)
  - ['Boom.notImplemented([message], [data])'](#boomnotimplementedmessage-data)
  - ['Boom.badGateway([message], [data])'](#boombadgatewaymessage-data)
  - ['Boom.serverUnavailable([message], [data])'](#boomserverunavailablemessage-data)
  - ['Boom.gatewayTimeout([message], [data])'](#boomgatewaytimeoutmessage-data)
...

function boom.unauthorized (message, scheme, attributes)

  • description and source-code
unauthorized = function (message, scheme, attributes) {          // Or function (message, wwwAuthenticate[])

    const err = internals.create(401, message, undefined, exports.unauthorized);

    if (!scheme) {
        return err;
    }

    let wwwAuthenticate = '';

    if (typeof scheme === 'string') {

        // function (message, scheme, attributes)

        wwwAuthenticate = scheme;

        if (attributes || message) {
            err.output.payload.attributes = {};
        }

        if (attributes) {
            if (typeof attributes === 'string') {
                wwwAuthenticate = wwwAuthenticate + ' ' + Hoek.escapeHeaderAttribute(attributes);
                err.output.payload.attributes = attributes;
            }
            else {
                const names = Object.keys(attributes);
                for (let i = 0; i < names.length; ++i) {
                    const name = names[i];
                    if (i) {
                        wwwAuthenticate = wwwAuthenticate + ',';
                    }

                    let value = attributes[name];
                    if (value === null ||
                        value === undefined) {              // Value can be zero

                        value = '';
                    }
                    wwwAuthenticate = wwwAuthenticate + ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"';
                    err.output.payload.attributes[name] = value;
                }
            }
        }


        if (message) {
            if (attributes) {
                wwwAuthenticate = wwwAuthenticate + ',';
            }
            wwwAuthenticate = wwwAuthenticate + ' error="' + Hoek.escapeHeaderAttribute(message) + '"';
            err.output.payload.attributes.error = message;
        }
        else {
            err.isMissing = true;
        }
    }
    else {

        // function (message, wwwAuthenticate[])

        const wwwArray = scheme;
        for (let i = 0; i < wwwArray.length; ++i) {
            if (i) {
                wwwAuthenticate = wwwAuthenticate + ', ';
            }

            wwwAuthenticate = wwwAuthenticate + wwwArray[i];
        }
    }

    err.output.headers['WWW-Authenticate'] = wwwAuthenticate;

    return err;
}
  • example usage
...

- [Boom](#boom)
- [Helper Methods](#helper-methods)
  - ['wrap(error, [statusCode], [message])'](#wraperror-statuscode-message)
  - ['create(statusCode, [message], [data])'](#createstatuscode-message-data)
- [HTTP 4xx Errors](#http-4xx-errors)
  - ['Boom.badRequest([message], [data])'](#boombadrequestmessage-data)
  - ['Boom.unauthorized([message], [scheme], [attributes])'](#boomunauthorizedmessage-scheme-attributes)
  - ['Boom.paymentRequired([message], [data])'](#boompaymentrequiredmessage-data)
  - ['Boom.forbidden([message], [data])'](#boomforbiddenmessage-data)
  - ['Boom.notFound([message], [data])'](#boomnotfoundmessage-data)
  - ['Boom.methodNotAllowed([message], [data], [allow])'](#boommethodnotallowedmessage-data-allow)
  - ['Boom.notAcceptable([message], [data])'](#boomnotacceptablemessage-data)
  - ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
  - ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
...

function boom.unsupportedMediaType (message, data)

  • description and source-code
unsupportedMediaType = function (message, data) {

    return internals.create(415, message, data, exports.unsupportedMediaType);
}
  • example usage
...
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
- ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
- ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
- ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
- ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
- ['Boom.badData([message], [data])'](#boombaddatamessage-data)
- ['Boom.locked([message], [data])'](#boomlockedmessage-data)
- ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
- ['Boom.tooManyRequests([message], [data])'](#boomtoomanyrequestsmessage-data)
...

function boom.uriTooLong (message, data)

  • description and source-code
uriTooLong = function (message, data) {

    return internals.create(414, message, data, exports.uriTooLong);
}
  • example usage
...
- ['Boom.proxyAuthRequired([message], [data])'](#boomproxyauthrequiredmessage-data)
- ['Boom.clientTimeout([message], [data])'](#boomclienttimeoutmessage-data)
- ['Boom.conflict([message], [data])'](#boomconflictmessage-data)
- ['Boom.resourceGone([message], [data])'](#boomresourcegonemessage-data)
- ['Boom.lengthRequired([message], [data])'](#boomlengthrequiredmessage-data)
- ['Boom.preconditionFailed([message], [data])'](#boompreconditionfailedmessage-data)
- ['Boom.entityTooLarge([message], [data])'](#boomentitytoolargemessage-data)
- ['Boom.uriTooLong([message], [data])'](#boomuritoolongmessage-data)
- ['Boom.unsupportedMediaType([message], [data])'](#boomunsupportedmediatypemessage-data)
- ['Boom.rangeNotSatisfiable([message], [data])'](#boomrangenotsatisfiablemessage-data)
- ['Boom.expectationFailed([message], [data])'](#boomexpectationfailedmessage-data)
- ['Boom.teapot([message], [data])'](#boomteapotmessage-data)
- ['Boom.badData([message], [data])'](#boombaddatamessage-data)
- ['Boom.locked([message], [data])'](#boomlockedmessage-data)
- ['Boom.preconditionRequired([message], [data])'](#boompreconditionrequiredmessage-data)
...

function boom.wrap (error, statusCode, message)

  • description and source-code
wrap = function (error, statusCode, message) {

    Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object');
    Hoek.assert(!error.isBoom || (!statusCode && !message), 'Cannot provide statusCode or message with boom error');

    return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message));
}
  • example usage
...
- 'error' - the error object to wrap. If 'error' is already a **boom** object, returns back the same object.
- 'statusCode' - optional HTTP status code. Defaults to '500'.
- 'message' - optional message string. If the error already has a message, it adds the message as a prefix.
  Defaults to no message.

'''js
var error = new Error('Unexpected input');
Boom.wrap(error, 400);
'''

### 'create(statusCode, [message], [data])'

Generates an 'Error' object with the **boom** decorations where:
- 'statusCode' - an HTTP error code number. Must be greater or equal 400.
- 'message' - optional message string.
...

misc