-
-
Notifications
You must be signed in to change notification settings - Fork 936
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
Set error codes on all errors #1711
Comments
In regards to the documentation this is expected. |
Tnx for the quick response. I wasn't able to deduct this from the documentation, so thanks for clarifying |
Additionally: shouldn't the code property on HTTPError instances be set to 'HTTPError'? According to the docs: |
Per @sindresorhus comments in #1739 it would be good to take a comprehensive approach to the code property for all error objects. The plain RequestError seems to always have a code associated with it that correlates to a Linux kind of error
The other child error messages all seem to return with the code property as undefined. As also stated it would be good to follow a Node.JS convention of ERR_*. I might suggest
|
|
Otherwise, looks good to me. |
|
What would you like to discuss?
On HTTPErrors the statusCode of the response is not exposed directly. You have to go through the HTTPError.response to get the statusCode
I would've expected the statusCode to be directly exposed on the HTTPError or otherwise set as the value of the
code
property, but neither is trueIs that as expected or is this a bug?
Checklist
The text was updated successfully, but these errors were encountered: