-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Better handling for non-XML responses from Twitter #41
Comments
That'd be awesome. If you can provide a sample of this type of response (or a way to reproducible force it to happen), I'll add a test case for it. I've never seen such thing myself. |
Sure. It's a very odd and rare indeed. We've been getting pretty high Twitter traffic and have only seen it twice so far. The content that Twitter sends is:
I'm not aware of a way to force it to occur. I'm guessing it only happens when Twitter is having a rather severe issue with their systems. |
same error |
Same error here, and even cause out of memory |
In certain failure conditions Twitter returns HTML (with the one-handed robot image) rather than an XML response for
getOAuthAccessToken
and/orgetOAuthRequestToken
. In this casepassport-twitter
will propagate anError
object with a message set to the HTML of the returned page, which is difficult to deal with and doesn't present well to users or in logs.I would suggest that
parseErrorResponse
should returnnull
in the case thatbody
isn't well-formed XML and/or doesn't contain the expected elements so that '_createOAuthError' can return anError
with a more useful message. If the body is potentially useful, perhaps it could be added as a separate property of theError
object?Thanks for considering,
Kevin
The text was updated successfully, but these errors were encountered: