hapijs / joi

The most powerful data validation library for JS
Other
20.95k stars 1.51k forks source link

Not getting custom error message when using .messages() #2956

Closed Juansu01 closed 1 year ago

Juansu01 commented 1 year ago

Support plan

Marsup commented 1 year ago

That's not a joi issue but likely a hapi misuse. hapi prevents echo attacks by default, so it hides validation errors behind a generic one. If you know you're safe, you can throw the real error in a failAction: https://runkit.com/embed/nehziyxjalau

Juansu01 commented 1 year ago

I see, thank you so much, I got the expected behavior