Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

SystemExit raised on duplicate retweet #312

Closed
rwc9u opened this Issue · 1 comment

2 participants

@rwc9u

If I try to retweet a tweet I have already retweeted, I see the following for ruby 1.8.7

>> begin
?> c.retweet(id_str)
>> rescue Exception => e
>> puts e.inspect
>> end
/Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/response/raise_error.rb:19:in `on_complete': sharing is not permissable for this status (Share validations failed) (Twitter::Error::Forbidden)
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/faraday-0.8.1/lib/faraday/response.rb:9:in `call'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/faraday-0.8.1/lib/faraday/response.rb:63:in `on_complete'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/faraday-0.8.1/lib/faraday/response.rb:8:in `call'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/faraday-0.8.1/lib/faraday/request/url_encoded.rb:14:in `call'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/faraday-0.8.1/lib/faraday/request/multipart.rb:13:in `call'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/request/multipart_with_file.rb:21:in `call'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/faraday-0.8.1/lib/faraday/connection.rb:226:in `run_request'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/client.rb:74:in `request'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/client.rb:44:in `post'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/api.rb:2117:in `retweet'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/core_ext/enumerable.rb:6:in `threaded_map'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/core_ext/enumerable.rb:6:in `initialize'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/core_ext/enumerable.rb:6:in `new'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/core_ext/enumerable.rb:6:in `threaded_map'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/core_ext/enumerable.rb:5:in `each'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/core_ext/enumerable.rb:5:in `threaded_map'
    from /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/api.rb:2116:in `retweet'
    from (irb):20:in `irb_binding'
    from /Users/rchristie/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
    from /Users/rchristie/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/irb/workspace.rb:52
#<SystemExit: #<SystemExit:0x10c440bf8>>
=> nil
>> 

If I use the debugger and step into the library I see the following:

/Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/error.rb:33
@wrapped_exception ? @wrapped_exception.backtrace : super
(rdb:1) l
[28, 37] in /Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/error.rb
   28        end
   29      end
   30  
   31      def backtrace
   32        debugger
=> 33        @wrapped_exception ? @wrapped_exception.backtrace : super
   34      end
   35  
   36    end
   37  end
(rdb:1) next
/Users/rchristie/dev/test_twitter/vendor/ruby/1.8/gems/twitter-3.7.0/lib/twitter/error.rb:32: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.4.0]

Abort trap: 6

ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.4.0]

@sferik sferik closed this in 57ef117
@sferik
Owner

For me, it raises Twitter::Error::Forbidden, which is the expected behavior. I've added this to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.