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

TwythonError hides too many details from error message #482

Open
anentropic opened this issue Feb 6, 2018 · 1 comment
Open

TwythonError hides too many details from error message #482

anentropic opened this issue Feb 6, 2018 · 1 comment

Comments

@anentropic
Copy link

errors are raised something like:

raise TwythonError(
    error_message,  # text of first error if there are multiple
    error_code=response.status_code,
)

In Twitter API docs the errors are assigned an error code

For example the rate limit for posting status updates will return http 403 with error code 88, but the TwythonError only gives us 403 (plus the message "Rate limit exceeded")

So we can match on the text of the error but we wonder if Twitter may localise the text or amend the description at some point.

It would be nice to have access to the error code in error_code, with the http response status code as a separate attribute. In fact it would be useful to have the whole error body to work with.

@anentropic anentropic changed the title TwythonError swallows too many details from error message TwythonError hides too many details from error message Feb 6, 2018
@michaelhelmick
Copy link
Collaborator

@anentropic that sounds wonderful. I'd be open to a PR that changes error_code to the Twitter error_code and a new status_code attribute on TwythonError

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

2 participants