-
Notifications
You must be signed in to change notification settings - Fork 581
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
✨ create_commit: more user-friendly errors on HTTP 400 #963
Conversation
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks nice, but it might cause some friction if users are catching those exceptions.
I'd suggest an exception class which inherits from ValueError
and HTTPError
so that existing user code would work.
The methods which can raise this exception can document it as ValueError
, but if users are already catching HTTPError
, their code wouldn't break after an upgrade.
WDYT?
That's a very valid point @adrinjalali, thanks for the suggestion! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM.
cc @Wauplin |
Related to #962
This PR converts HTTP 400 errors from
/api/preupload
and/api/commit
APIs intoValueError
sSuggestions/feedback welcome