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

Better error handling #19

Open
AdriVanHoudt opened this issue Jun 23, 2016 · 3 comments
Open

Better error handling #19

AdriVanHoudt opened this issue Jun 23, 2016 · 3 comments
Assignees

Comments

@AdriVanHoudt
Copy link
Contributor

I am encountering an issue where Fullcontact returns a 503 (see https://www.fullcontact.com/developer/docs/#response-codes)

Now I need access to the headers of the response to be able to properly deal with this.

I suggest adding the headers to the error.

@AdriVanHoudt AdriVanHoudt self-assigned this Jun 23, 2016
@3rd-Eden
Copy link
Member

Adding additional info to the returned error seems like a good plain. I've been doing that for quite a while now for HTTP responses using: https://github.com/unshiftio/failure

Where I add things like statusCode, body and headers to the error object. It also automatically adds a toJSON method to the errors so you can easily JSON stringify them for logging purposes.

@AdriVanHoudt
Copy link
Contributor Author

seems good, you want me to do a pr with that?

@3rd-Eden
Copy link
Member

@AdriVanHoudt yeah, a PR would be helpful as you know which props you need to debug these error codes.

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

No branches or pull requests

2 participants