Comments (6)
You can just change the output.payload.message
property, but that would be the wrong way to do that. The right way is to add more information to output.payload
alongside message
.
from boom.
how to add more information to output.payload alongside message.
can you please show me by eg.
from boom.
var error = Boom.badRequest('you made a mistake');
error.output.payload.severity = 'warn';
from boom.
Thanks for your help,
Can you tell me that how to the same with Joi validation errors also
like payload, params validation , I want its message to be like
"messages": [
{"text":"this is a server message or error"}
]
but now its
"message" : "this is a server message"
from boom.
Same idea, just use the failAction
option to set a function that does the rewrite.
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.