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

HttpErrors Codes Changed & Not Reflected In Documentation #1206

Closed
NeilCresswell opened this issue Oct 15, 2016 · 2 comments
Closed

HttpErrors Codes Changed & Not Reflected In Documentation #1206

NeilCresswell opened this issue Oct 15, 2016 · 2 comments
Assignees
Labels

Comments

@NeilCresswell
Copy link

The built-in list of HttpErrors at http://restify.com/#error-handling includes:

  • 412 PreconditionFailedError
  • 413 RequestEntityTooLargeError
  • 414 RequesturiTooLargeError
  • 415 UnsupportedMediaTypeError

In the past I had code in a long-standing app that I believe tested against RequestEntityTooLargeError OK, since I was testing some upload file sizes when the code was written, but I noticed today that is now failing in some logs. Took a brief look at restify.errors and found that RequestEntityTooLargeError doesn't appear to be present. Instead, I found the following:

  • PreconditionFailedError
  • PayloadTooLargeError (different)
  • UriTooLongError (different)
  • UnsupportedMediaTypeError

Might be a good idea to possibly support the old codes too to match the documentation, or if not, at least to update the documentation to match the code base?

@DonutEspresso
Copy link
Member

DonutEspresso commented Oct 15, 2016

Hello, thank you for the report. Is there any chance you recently updated to Node4+? The error codes are automatically generated from the core http module's status codes, and there was a breaking change between 0.x and 4. You can test it yourself by switching between node versions and running this snippet:

var http = require('http');
console.log(http.STATUS_CODES);

I agree that the documentation can be updated to note this breaking change; I suspect many may be unaware.

@yunong
Copy link
Member

yunong commented Jan 9, 2017

@DonutEspresso would you mind updating the docs to reflect this?

@yunong yunong added the Docs label Jan 9, 2017
retrohacker pushed a commit that referenced this issue Apr 29, 2017
Closes:

#289
#381
#474
#575
#790
#633
#717
#576
#576
#909
#875
#860
#853
#850
#829
#813
#801
#921
#1101
#1019
#989
#632
#708
#737
#859
#1326
#1327
#927
#1099
#1068
#1040
#1035
#957
#948
#1134
#1136
#1183
#1206
#1286
#1323

> Note: this issue closes _but does not resolve_ the issues listed, we are just tracking them in another medium
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

4 participants