Git Product home page Git Product logo

hapi-boom-decorators's Introduction

hapi-boom-decorators

Greenkeeper badge

Known Vulnerabilities js-semistandard-style Circle CI

NPM

A plugin for hapi.js to make responding with Boom errors a little less verbose by decorating the response toolkit with equivilent functions.

This module is tested against Node.js versions 8 and 10. The minimum required version of hapi.js is 17. If you require compatibility with an older version use version 3.0.1 or older.

Install

npm install hapi-boom-decorators --save

Add plugin to hapi server

const hapiBoomDecorators = require('hapi-boom-decorators');

const server = new Hapi.Server();

await server.register(hapiBoomDecorators);

API

The normal way of replying with a Boom error response:

const Boom = require('boom');

server.route({
  method: 'GET',
  path: '/resource/{id}',
  handler: (request, h) => {
    throw Boom.notFound();
  }
});

With hapi-boom-decorators:

server.route({
  method: 'GET',
  path: '/resource/{id}',
  handler: (request, h) => {
    return h.notFound();
  }
})

Check the Boom API documentation for all Boom error types. Every 4xx and 5xxx error, as well as boomify can be called on the response toolkit.

hapi-boom-decorators's People

Contributors

brainsiq avatar greenkeeper[bot] avatar greenkeeperio-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hapi-boom-decorators's Issues

An in-range update of mocha is breaking the build 🚨

Version 3.5.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.4.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ ci/circleci Your tests failed on CircleCI Details

Release Notes free-as-in-freezing

3.5.0 / 2017-07-31

πŸ“° News

  • Mocha now has a code of conduct (thanks @kungapal!).
  • Old issues and PRs are now being marked "stale" by Probot's "Stale" plugin. If an issue is marked as such, and you would like to see it remain open, simply add a new comment to the ticket or PR.
  • WARNING: Support for non-ES5-compliant environments will be dropped starting with version 4.0.0 of Mocha!

πŸ”’ Security Fixes

πŸŽ‰ Enhancements

  • #2696: Add --forbid-only and --forbid-pending flags. Use these in CI or hooks to ensure tests aren't accidentally being skipped! (@charlierudolph)
  • #2813: Support Node.js 8's --napi-modules flag (@jupp0r)

πŸ”© Other

Commits

The new version differs by 34 commits.

  • 82d879f Release v3.5.0
  • bf687ce update mocha.js for v3.5.0
  • ec73c9a update date for release of v3.5.0 in CHANGELOG [ci skip]
  • 1ba2cfc update CHANGELOG.md for v3.5.0 [ci skip]
  • 065e14e remove custom install script from travis (no longer needed)
  • 4e87046 update karma-sauce-launcher URL for npm@5
  • 6886ccc increase timeout for slow-grepping test
  • 2408d90 Make dependencies use older version of readable-stream to work around incompatibilities introduced by 2.3.0 on June 19th
  • 68a1466 Try not clearing the env for debug in the integration test and see if that fixes Node 0.10 on AppVeyor; if need be, some other fix/workaround can be applied to handle whatever was up with debug without causing this issue
  • 958fbb4 Update new tests to work in browser per test hierarchy reorganization
  • 1df7c94 Merge pull request #2704 from seppevs/increase_test_coverage_of_mocha_js
  • 1f270cd Stop timing out (#2889)
  • 27c7496 upgrade to [email protected]; closes #2859 (#2860)
  • 50fc47d fix CI; closes #2867 (#2868)
  • 1b1377c Add test for ignoreLeaks and fix descriptions

There are 34 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of hapi is breaking the build 🚨

Version 16.0.0 of hapi just got published.

Branch Build failing 🚨
Dependency hapi
Current Version 15.2.0
Type peerDependency

This version is covered by your current version range and after updating it in your project the build failed.

As hapi is β€œonly” a peerDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ ci/circleci Your tests failed on CircleCI Details
Commits

The new version differs by 24 commits .

  • 3c1d6be Call dep. For #3396
  • 386bb94 Closes #3381
  • b617d63 Closes #3347
  • 6735fdb Test for #3370
  • 68d6ea7 Cleanup for #3242
  • 10bcdaa Merge pull request #3358 from turtleDev/master
  • 9676577 Cleanup for #3372
  • 5c10b22 Merge pull request #3372 from dahjelle/fix-graceful-restarts-for-longpoll-and-https
  • 09c2e33 Prevent error headers from being modified. Closes #3378
  • 4596dd9 Merge pull request #3380 from wwalser/reusable-booms
  • db8ffbf Merge branch 'master' of github.com:hapijs/hapi
  • 0ca8cea Update deps. Closes #3383. Closes #3384. Closes #3385. Closes #3386. Closes #3387. Closes #3388. Closes #3389. Closes #3390. Closes #3391. Closes #3392. Closes #3393. Closes #3394. Closes #3395. Closes #3396. Closes #3397
  • f9c51ef Regression test to ensure that Error objects can also be reused the same as Boom objects.
  • 5322910 Response to code review, clone boom.output instead of just boom.output.headers.
  • b700774 Proposed fix for issue #3378.

There are 24 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of hapi is breaking the build 🚨

The devDependency hapi was updated from 17.6.4 to 17.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

hapi is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 2 commits.

  • 164f97f 17.7.0
  • b0fbe47 node, hapi, and plugin version requirements. Closes #3867

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of mocha is breaking the build 🚨

Version 3.4.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ ci/circleci Your tests failed on CircleCI Details

Release Notes v3.4.0

Mocha is now moving to a quicker release schedule: when non-breaking changes are merged, a release should happen that week.

This week's highlights:

  • allowUncaught added to commandline as --allow-uncaught (and bugfixed)
  • warning-related Node flags

πŸŽ‰ Enhancements

πŸ› Fixes

πŸ”© Other

Commits

The new version differs by 9 commits0.

  • 7554b31 Add Changelog for v3.4.0
  • 9f7f7ed Add --trace-warnings flag
  • 92561c8 Add --no-warnings flag
  • ceee976 lint test/integration/fixtures/simple-reporter.js
  • dcfc094 Revert "use semistandard directly"
  • 93392dd no special case for macOS running Karma locally
  • 4d1d91d --allow-uncaught cli option
  • fb1e083 fix allowUncaught in browser
  • 4ed3fc5 Add license report and scan status

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Missing 500

It's not documented, but Boom has a .internal() method for generating a 500 error. It'd be nice to have it in boom-decorators as well.

An in-range update of hapi is breaking the build 🚨

The devDependency hapi was updated from 17.6.0 to 17.6.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

hapi is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 6 commits.

  • 6ebf21c Add node 11
  • 082e5d8 override install
  • e16e5e1 17.6.1
  • 6da7a97 Update deps. Closes #3833. Closes #3834. Closes #3835. Closes #3836. Closes #3837. Closes #3838. Closes #3839. Closes #3840. Closes #3841. Closes #3841. Closes #3842. Closes #3843. Closes #3844. Closes #3845. Closes #3846. Closes #3847. Closes #3848. Closes #3850. Closes #3851. Closes #3852. Closes #3853. Closes #3854. Closes #3855. Closes #3856
  • 7ffd301 Tweak test
  • ec1c830 Tweak test

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of boom is breaking the build 🚨

The dependency boom was updated from 7.2.2 to 7.3.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

boom is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Shrinkwrap and size of dependencies

I just used https://github.com/siddharthkp/cost-of-modules on my module, which depends on hapi-boom-decorators to determine why mine seemd so big. I though it was nano (ha, there's an ironic name ;-) but turns out your modules and children take up 70 MiB!

$ cd hapi-couchdb-login/
$ cost-of-modules
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ name                 β”‚ children     β”‚ size   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ hapi-boom-decorators β”‚ 59           β”‚ 70.91M β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ cloudant-nano        β”‚ 99           β”‚ 12.53M β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ lodash               β”‚ 0            β”‚ 4.88M  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ hapi-auth-cookie     β”‚ 8            β”‚ 4.80M  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ boom                 β”‚ 1            β”‚ 0.31M  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ pify                 β”‚ 0            β”‚ 0.02M  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 6 modules            β”‚ 103 children β”‚ 84.72M β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜

I'm not sure how shrinkwrap works, but I found this version from 2.0.1:
https://github.com/brainsiq/hapi-boom-decorators/blob/beb86e10918e2a031e365322987c9d2089acb1d6/npm-shrinkwrap.json
which is tiny compared to most other versions containing babel stuff and much more.

Am I imagining things, or could we shave of 65 MiB of dependencies here?

An in-range update of hapi is breaking the build 🚨

Version 16.5.0 of hapi just got published.

Branch Build failing 🚨
Dependency hapi
Current Version 16.4.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As hapi is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ ci/circleci Your tests failed on CircleCI Details

Commits

The new version differs by 44 commits.

  • c89269a Update statehood. Closes #3551
  • 89e2b20 Update content. Closes #3550
  • ae12c40 Drain request stream on special handlers. Closes #3480
  • 355e8eb Switch to use Boom.boomify()
  • 5269898 Update boom. Closes #3548
  • f1709a3 Update joi. Closes #3545
  • f818228 Update deps. Closes #3543. Closes #3544
  • 2afa365 Handle emitter errors in request lifecycle. Closes #3464
  • 0f70551 Optimize request emitter creation. Closes #3532
  • 23d83dd Update podium. Closes #3542
  • d54e4f6 Update hoek. Closes #3541
  • 52a03b1 Cleanup for #3539
  • b947831 Merge pull request #3539 from jeff-kilbride/feature/payload_failAction_custom_handler
  • 9f8ea61 16.5.0
  • 832ed3d Merge pull request #3526 from hapijs/wildcard-debug

There are 44 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of chokidar-cli is breaking the build 🚨

The devDependency chokidar-cli was updated from 1.2.1 to 1.2.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

chokidar-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Release Notes for 1.2.2
  • Update dependencies, fixes #64
Commits

The new version differs by 7 commits.

  • 00aee90 Bump version to 1.2.2
  • a4eee2b Update dependencies
  • 64fc638 Add .npmignore
  • 0420ae3 Update README.md
  • 8a277c2 Merge pull request #57 from Pomax/patch-1
  • 3e27895 Update CONTRIBUTING.md
  • d2f5a20 Explain what devs need to do to maximise platform compatibility

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Hapi v17 Support

Overview

If you are not aware yet, Hapi v17 is making the transition from callbacks to async/await, as well as deprecating some other rarely used functionality. This is a breaking change that may make your plugin no longer compatible with the Hapi API.

Changelog

Draft release notes can be found here: hapijs/hapi#3658

Target Release

The target release date for v17 is the beginning of November.

Tasks

  • Reply to this to acknowledge that you are actively maintaining this module and are willing to update it
  • Update plugin to be fully async/await compatible using the v17 branch from Hapi for testing

    Possible dev flow for updating

    • Clone Hapi
    • npm link within the Hapi repo
    • npm link hapi within your plugin repo
    • Your plugin will now be using v17 of Hapi branch for tests
  • Release new major version of your plugin on npm. Please use a major version increment as this will be a breaking change and it would be terrible for it to sneak into current versions of Hapi.

Notes

  • Support is being dropped for all versions of Node <8.0.0.
  • Hapi v16 will continue to be supported for as long as there exists a Node LTS actively being supported that is not compatible with v17.
  • Targeted release date is November 1st, 2017. Please try to have your plugin updated before then.
  • This issue is being opened because your plugin is listed on the official hapi website

An in-range update of boom is breaking the build 🚨

The dependency boom was updated from 7.2.0 to 7.2.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

boom is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Node versions supported

With the recent change 02fa06a, Node 4.x isn't supported anymore.

Is there a way to keep support for Node 4 (the "..." argument is failing)?

Otherwise, please update the package.json engine field and maybe consider this a major (breaking) change?

An in-range update of hapi is breaking the build 🚨

The devDependency hapi was updated from 17.5.4 to 17.5.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

hapi is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 4 commits.

  • 59e1764 17.5.5
  • 3367eca Fix post cycle early exit. Closes #3821
  • 76d9d32 Merge pull request #3819 from dwelle/patch-1
  • df18dc7 fix typo and add missing backticks in API.md

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.