
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
Hapi plugin to transform application errors into boom error responses. Where each key in the errors object corresponds with a matching boom method.
var hapi = require('hapi');
var boomstick = require('boomstick');
var server = new hapi.Server();
server.connection();
server.register({
register: boomstick,
options: {
success: function(request){
return !(request.response instanceof Error);
},
errors: {
badRequest: function(request){
return (request.response instanceof InvalidRequestError);
},
notFound: function(request){
return (request.response.code === 404);
}
}
}
}, function(){
server.start();
});
success: A checkFunction that is executed before all of the potential error cases. If the success case is matched the errors checks are bypassed entirely.
'errors': An Object that contains a key for each boom method you want returned, along with a matching checkFunction for determining when that error case has occured. Each key in the errors object needs to exactly match the name of the boom method that you want executed.
'checkFunction': - A function that returns a boolean and has access to the Hapi request object, for error cases it should return true if that boom error should be generated.
'metadataKey': - A string denoting a key name, if the source Error has a value for that key it will be copied into the final error response. (Default: 'expose')
Boomstick is attached at the onPostHandler point of the Hapi request lifecycle. In the event that the function in the options.success object returns true boomstick will pass the request through untouched. If success returns false each of the other cases is checked and when one is true a boom error is generated and passed into your reply. If none of the errors are matched the request is passed through untouched.
MIT
FAQs
Hapi plugin to transform application errors into boom error responses.
The npm package boomstick receives a total of 0 weekly downloads. As such, boomstick popularity was classified as not popular.
We found that boomstick 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
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.