AveryRegier / socialauth

Automatically exported from code.google.com/p/socialauth
0 stars 1 forks source link

Add more details for Twitter statuses != 200 #355

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a tweet that is more than 140 characters or post the same message 
twice
2.
3.

What is the expected output? What do you see instead?
When using the twitter, when trying to do several different things like posting 
a message that is over 140 characters, tweeting an identical message twice, or 
going over the allowed number of daily tweets, Twitter will give a 403 error 
and extra details in the body of the message.  The library simply reports back 
a 403 error with no details so it is difficult to track down why the user 
experienced the problem.

What version of the product are you using? On what operating system?
4.4 using socialauth-android on an android device

Please provide any additional information below.
I was able to create my own jar that gave me more details.  In my situation, 
the tweet was over 140 characters (although actual length was exactly 140 
characters, I had included a URL in the post which Twitter reduces the 140 
characters to handle the URL). Perhaps there could be a method to get error 
details and thus allow us to deliver error messages to the end user.

My quick fix was to set line 281 n TwitterImpl.java to this:
+ ". Status :" + serviceResponse.getStatus() + " " + 
serviceResponse.getErrorStreamAsString(Constants.ENCODING));

Original issue reported on code.google.com by chiplei...@gmail.com on 22 Jul 2014 at 3:03