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

Make error message more verbose when creating a repo #44

Merged
merged 2 commits into from
May 17, 2021
Merged

Conversation

osanseviero
Copy link
Contributor

I recently had some issues which could have been easily found if the error message was more verbose.

Before:

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://huggingface.co/api/repos/create

After:

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://huggingface.co/api/repos/create - Only regular characters and '-', '_', '.' accepted

@osanseviero osanseviero requested a review from julien-c May 17, 2021 07:47
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just wondering if .json() is compute intensive, or can raise an error (if not a JSON response for instance), am assuming not to both

@osanseviero
Copy link
Contributor Author

r.json() would already raise an error if not a json response.

In terms of speed, the method uses simplejson which is supposed to be very fast.

@osanseviero osanseviero merged commit 3ee9af2 into main May 17, 2021
@osanseviero osanseviero deleted the verbose_push branch May 17, 2021 12:23
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.

3 participants