Skip to content

output validation error pass source along #3194

@catalint

Description

@catalint

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.

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions