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

Relocate errors #154

Closed
felix-hilden opened this issue Feb 26, 2020 · 3 comments
Closed

Relocate errors #154

felix-hilden opened this issue Feb 26, 2020 · 3 comments
Assignees
Labels
change Change behaviour of an existing component
Milestone

Comments

@felix-hilden
Copy link
Owner

HTTP errors are now raised in tekore.client.decor.error, which is quite lengthy if you're trying to import it for error handling. We should relocate them to tekore.error and maybe even consider importing them to the top level.

@felix-hilden felix-hilden added the change Change behaviour of an existing component label Feb 26, 2020
@felix-hilden felix-hilden added this to the v2.0.0 milestone Feb 26, 2020
@felix-hilden felix-hilden self-assigned this Feb 26, 2020
@felix-hilden
Copy link
Owner Author

With #81 and other changes lined up for Tekore 2.0, we could consider setting up an exception hierarchy. I'm not quite sure if it's better to create all errors through a base class, and the same for warnings.

@felix-hilden
Copy link
Owner Author

felix-hilden commented Apr 25, 2020

Maybe a base class is not the way to go. Warnings should inherit from user warnings, as they do already. Custom exceptions are only raised on bad HTTP codes and in id conversions. I think conversion is ok, but OAuthError in the auth module should be merged to the status code errors in client.

After we change from using Requests to HTTPX, the error base class should be either the error of HTTPX or a class of our own inheriting from that. Or we could have the HTTPError equivalent imported at the top level, from which users could use it directly without knowing it's a part of HTTPX.

@felix-hilden felix-hilden mentioned this issue Apr 26, 2020
3 tasks
@felix-hilden felix-hilden mentioned this issue May 7, 2020
11 tasks
@felix-hilden
Copy link
Owner Author

We could also provide bases for client and server errors separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change Change behaviour of an existing component
Projects
None yet
Development

No branches or pull requests

1 participant