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

Sixpack not handling non-500 errors #25

Open
mbueti opened this issue Jul 7, 2017 · 0 comments
Open

Sixpack not handling non-500 errors #25

mbueti opened this issue Jul 7, 2017 · 0 comments

Comments

@mbueti
Copy link

mbueti commented Jul 7, 2017

In certain cases, web servers can return 5XX errors that are not specifically 500. In our case, we're seeing 502 errors come through if the server becomes unavailable. With these errors, nginx servers return plain HTML documents.

Because sixpack checks strictly for 500 error codes, and then JSON parses the response body if status !== 500, 502 and 502 responses can cause an exception to be thrown, and the process thread to die.

The PR at #24 checks for all 5XX errors when receiving results, and try/catches the JSON parse, in case a non-son response is returned, making the library significantly more fault tolerant.

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

1 participant