added http response headers access to all errors and some methods for accessing rate limit headers #150

merged 1 commit into from Mar 31, 2011

2 participants


I've been hacking this in for a long time now so I thought I'd see about getting it merged. Whenever I have a twitter error I'm always interested in the response http headers. Usually for information about rate limiting thought sometimes for other reasons. As twitter headers evolve I think it will be nice to always be able to catch errors and look at the headers for useful information on how to handle the error.

Perhaps it should have been a separate commit, it could be rebased, but I have some methods for handling rate limit headers. I have a retry_after method that works similarly to the method used by the search 420 error for methods which receive an array of statuses which can come from either search or a user's timeline and I can catch either rate limit error and respond in the same way.

@thoughtafter thoughtafter Change error handling to always have a copy of response headers
added some methods related to parsing rate limit headers
@sferik sferik merged commit 6db6fe2 into sferik:master Mar 31, 2011

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment