0

how do I rescue and ignore the exceptions thrown by twitter gem? what I want is this

begin
Twitter.update(@tweet)
rescue Twitter::Error
 // continue action 1 
else 
 // continue action 1
end 

is there a better way of doing this so I don't duplicate the code?

user1256143
  • 11
  • 2
  • 3

1 Answers1

1

If you don't care about handling the error, try this:

Twitter.update(@tweet) rescue Twitter::Error
# continue action 1 
Cade
  • 3,151
  • 18
  • 22