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

Tweepy exception hierarchy #209

Closed
beaumartinez opened this issue Sep 9, 2012 · 4 comments
Closed

Tweepy exception hierarchy #209

beaumartinez opened this issue Sep 9, 2012 · 4 comments

Comments

@beaumartinez
Copy link

Tweepy uses TweepError for all errors—whether they be network errors, authentication errors, or any other flavour.

This makes handling the different underlying reasons difficult—I don't know if the error was because Twitter is down, or because the user revoked my app.

I'd love it if Tweepy had an exception hierarchy—overloading Python's own. TweepError would still be the base class—maintaining backwards compatibility—but we'd also have other well-defined exception types. TweepNetworkError, inheriting from both TweepError and IOError, for example.
#16 (from three years ago, wow) touches on this issue—and to fix it, you added the HTTP response to the exception. However, that isn't available everywhere, nor is it always possible—OAuthHandler. get_username throws a TweepError without the HTTP response, for example. #58 is similar as well.

Let me know what you think. I don't mind adding the code myself, and I'm sure it'd be a welcome change. It'd make buiding robust apps on top of Tweepy easier—and make making them more user friendly easier as well.

Keep up the awesome work!

@Aaron1011
Copy link
Contributor

@beaumartinez: I'm sorry no one ever got to this. If you're still interested after all this time, I'd love it if you'd submit a PR adding this. Again, I'm so sorry that this issue got ignored.

@beaumartinez
Copy link
Author

Thanks for the apology Aaron. I haven't got round to doing it mate, but it'd be a nice thing to have.

@Araib93
Copy link

Araib93 commented Jan 1, 2017

This has been driving me crazy for days now... I keep getting different errors but all get caught in a single exception... makes it super hard to code right, can this be reopened?

@darshan2203
Copy link

Guys any update on this issue?

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

No branches or pull requests

4 participants