output validation error pass source along
When request response validation fails , when creating the Boom object, also pass along the original error object ?
https://github.com/hapijs/hapi/blob/master/lib/validation.js#L201 right now it's
return next(Boom.badImplementation(err.message));
what do you say about
return next(Boom.badImplementation(err.message, err));
or
return next(Boom.badImplementation(err.message, value));
Use case :
I'm trying to log these errors in sentry and I'm only getting the message that it failed validation at some key, if I add the err or value in data, I can see the context and debug faster.
What are your thoughts on this ? I would do a PR if you are ok.
Why not do next(Boom.badImplementation(err)) and you can log/parse/send to sentry whatever you want on server.on('response', ...)
the way Boom is designed, it wants a message in the first param, not an error object , the second param is reserved for extra data
ah yes sorry missed that, you can still handle the error on server.on('response', ...) no?
Use the new failAction feature with a function.
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.