Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
hapi-boombox
Advanced tools
Hapi error conversion and logging
Boombox logs errors and is able to transform errors. Boombox logs errors, see below.
Provide Boombox with custom errors when registering. (Optional) an it will convert errors with messages that match a key in errors
and will return a new Boom error.
var Errors = require('./test/config/errors.json'); //Look here for an example!
server.register({
register: require('hapi-boombox'),
options: { errors: Errors }
}, callback);
E.g. you return new Error('RESOURCE_NOT_FOUND')
and the config states that this should return a Boom.notFound
(404). Boombox will do that for you instead of returning an internal server error.
Both methods will do a server.log
with hapi-boombox
as tag and the result as data.
error
: the original errorstack
: the stacktracerequest
: additional info about the request
path
, query
, method
, payload
, headers
, request.info
, credentials
credentials
: if present this will be an object that includes 2 properties from request.auth.credentials
.
id
and name
.100% test coverage! Also look in the tests for more examples.
Personally I use this in a Hapi server to use generic keys as errors in my code but to give the end user a decent error message and to easily match errors with the right error code. Maybe in the future this can also return localized errors.
FAQs
Boom error wrapper
The npm package hapi-boombox receives a total of 7 weekly downloads. As such, hapi-boombox popularity was classified as not popular.
We found that hapi-boombox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.