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

Document the hierarchy of error classes #1359

Merged
merged 2 commits into from
Jul 14, 2020

Conversation

redneb
Copy link
Contributor

@redneb redneb commented Jul 14, 2020

This PR addresses #1358. It also adds to the docs information about UploadError, which was previously missing. Note that while this PR contains only changes in the documentation, it effectively makes part of the public api of got the contract that all errors are instances of RequestError, except CancelError.

Checklist

  • I have read the documentation.
  • I have included a pull request description of my changes.

@redneb
Copy link
Contributor Author

redneb commented Jul 14, 2020

I don't like that CancelError is not a subclass of RequestError (unlike all other error types), but I guess it is fine as it can be argued that CancelError, unlike all other error types, is explicitly caused by the user of the library and not the library itself.

@szmarczak szmarczak merged commit 559526e into sindresorhus:master Jul 14, 2020
@szmarczak
Copy link
Collaborator

szmarczak commented Jul 14, 2020

@redneb Very good point! Can you make an issue about this please?

@redneb redneb deleted the fix-error-doc branch July 16, 2020 15:53
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.

None yet

2 participants