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

Remove error classes and use http-errors. #105

Merged
merged 2 commits into from
Aug 16, 2018
Merged

Remove error classes and use http-errors. #105

merged 2 commits into from
Aug 16, 2018

Conversation

jaydenseric
Copy link
Owner

  • Remove the previously exported error classes to use http-errors instead.
  • Error details are now snapshot tested.

Most errors were a pretty obvious conversion, but I do wonder about the errors for when the client unexpectedly disconnects. I chose the status code 499, which is a non-standard code used by nginx for Client Closed Request which seems like a perfect fit: https://httpstatuses.com/499. http-errors does not have a special class for this code though, so it falls back to a BadRequestError class name.

@jaydenseric
Copy link
Owner Author

@mike-marcacci YOLO I'm merging it, still let me know your thoughts though :)

@jaydenseric jaydenseric merged commit d0cf9fe into master Aug 16, 2018
@jaydenseric jaydenseric deleted the http-errors branch August 16, 2018 10:26
@mike-marcacci
Copy link
Collaborator

499 is the perfect code to use here, is it will mirror the logs in any nginx proxies, etc.

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

Successfully merging this pull request may close these issues.

2 participants