finalhandler icon indicating copy to clipboard operation
finalhandler copied to clipboard

Respect `expose` on thrown errors

Open dcherman opened this issue 6 years ago • 2 comments

https://www.npmjs.com/package/http-errors

When we're extracting the message out of a thrown error, we should consider respecting the expose property on it so that we provide consumers some way of exposing information to the client in the event that they want to return something like an HTTP 400 by using throw BadRequest('You must include an Id') from http-errors or a similar lib.

dcherman avatar Jul 02 '18 14:07 dcherman

Indeed, this is already planned! An initial implementation to expose err.message for custom response messages is available on the develop branch right now if you want to test it out.

dougwilson avatar Jul 02 '18 14:07 dougwilson

@dougwilson Any plan for merging develop branch changes to master?

ksathyanm avatar Aug 13 '19 03:08 ksathyanm