Comments (5)
Usually 500 errors are unexpected ones, you certainly don't want any of those errors leaking to your clients, that would be a security issue. You are probably not transforming those into appropriate boom errors.
from boom.
server.js
var Hapi = require('hapi');
var Boom = require('boom');
var server = new Hapi.Server();
server.connection({port: '8888'});
server.route({
method: 'GET',
path: '/test',
handler: function (request, reply) {
var err = new Error('custom message');
reply(Boom.wrap(err));
}
});
server.start();
$ node server.js
$ curl http://localhost:8888/test
{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"}
from boom.
Look at the documentation, it explicitly says that without any status code it defaults to 500.
from boom.
omg you are totally right
from boom.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
from boom.
Related Issues (20)
- Add change log or release notes. HOT 1
- Optional second param for Boom.isBoom() to verify status code
- Restore support for nodejs v10? HOT 1
- Boom.wrap is not a function HOT 1
- Get optional message from response HOT 1
- output.payload.attributes is not exposed in the .d.ts file HOT 6
- Latest v7-commercial release (v7.4.11) is broken HOT 2
- @hapi/boom error HOT 2
- When returning Boom.badImplemention from an handler the isBoom property is not set on the request.response HOT 1
- Extending Boom and unexpected instanceof behavior HOT 1
- Boomify throws when using multiple versions of Boom HOT 6
- Missing Boom.notFound etc error argument type support HOT 1
- Allow "unknown" values to be boomified HOT 24
- Changelog for @hapi/boom 10.0.0 HOT 4
- [Feature] Add support for the edge runtime
- Add support for native `cause` HOT 6
- missing 10.0.1 release at https://github.com/hapijs/boom/releases HOT 2
- Missing .stack value on node 21
- Badly implemented Boom like class can cause runtime error HOT 1
- Change of Dependency Name Breaks boom HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boom.