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
Comments
@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. |
Thanks for the apology Aaron. I haven't got round to doing it mate, but it'd be a nice thing to have. |
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? |
Guys any update on this issue? |
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 bothTweepError
andIOError
, 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!
The text was updated successfully, but these errors were encountered: