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

Fix error handling code in middleware/sendJSON #1108

Closed
2 tasks done
orangejulius opened this issue Mar 24, 2018 · 0 comments
Closed
2 tasks done

Fix error handling code in middleware/sendJSON #1108

orangejulius opened this issue Mar 24, 2018 · 0 comments
Labels

Comments

@orangejulius
Copy link
Member

orangejulius commented Mar 24, 2018

The error handling code in middleware/sendJSON.js has some potential problems:

  • It relies on a module, elasticsearch-exceptions, that is 3 years old and reportedly only supports Elasticsearch 1.4
  • In the case of errors, it sets the default error code to 400. This means that a lot of errors such as failures to connect to other services are reported as 400 instead of 500 errors. 400 errors should be reserved for cases where the user's input, such as query params, are incorrect.
@orangejulius orangejulius changed the title Rewrite/fix error handling code in middleware/sendJSON Fix error handling code in middleware/sendJSON Mar 24, 2018
@orangejulius orangejulius removed the fixme label Sep 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant