Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect expose on thrown errors #24

Open
dcherman opened this issue Jul 2, 2018 · 2 comments
Open

Respect expose on thrown errors #24

dcherman opened this issue Jul 2, 2018 · 2 comments

Comments

@dcherman
Copy link

dcherman commented Jul 2, 2018

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 dcherman changed the title Respect expose Respect expose on thrown errors Jul 2, 2018
@dougwilson
Copy link
Contributor

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.

@ksathyanm
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants