Closed (won't fix)
Project:
Twitter
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Sep 2010 at 04:44 UTC
Updated:
17 May 2013 at 07:49 UTC
Hello,
Simple use case : try to post a Tweet longer than 140 caracters (using some tokens, it is possible to go over the limit). Twitter module still echoes the message 'Successfully posted to Twitter'.
Actually, it has all it takes to display the appropriate error message : a TwitterException is thrown, but, not used (at the time, it is just catched to early, without any error handling).
I suggest to let the Exception propagate, until it reaches the level where it should be handled. My patch is attached.
Regards,
David
| Comment | File | Size | Author |
|---|---|---|---|
| twitter_catch_exceptions.patch | 1.59 KB | David Stosik |
Comments
Comment #1
David Stosik commentedUp ?
Comment #2
radiobuzzer commentedI was submitting nodes with "post to twitter" activated
My application didn't have a read/write access, but just read-only. Consequently, drupal was failing to write/post my tweets.
Though, even if failing to write, Drupal was giving the message 'Successfully posted to Twitter'. Is this the same case as above?
Comment #3
David Stosik commentedYes. A Twitter exception is catched, and nothing is done. Please try the patch and tell me if it solves anything. :)
Comment #4
jbrauer commentedThe patch does not apply cleanly for me. Specifically the twitter.lib.php file is skipped. I made the same changes manually and it works pretty well.
That is it does report the error on screen. It does not, however, lead to the error being recorded in watchdog which seems like it should happen.
Comment #5
danchadwick commentedAlso, in the try clause in twitter_post.module, twitter_nodeapi, the result of twitter_set_status(...) is saved in $result. twitter_set_status does not return anything (so $result will never have anything useful in it). The patch #0 does correct the error of trying to use $result in the catch. (I'm not actually using this, but I based some custom code off of it and noticed the problem.) Thanks for the module.
Comment #6
dddave commentedThis branch is no longer supported. If this issue is still relevant feel free to reactivate it against a relevant version.