From: "Abinoam Jr." Date: 2012-01-13T20:23:59+09:00 Subject: Re: Problem with "Exception" - suddenly stopped working On Thu, Jan 12, 2012 at 8:45 PM, Panagiotis Atmatzidis wrote: > Hello, > > thanks all for the answers. > > On 12 Ιαν 2012, at 22:35 , Peter Vandenabeele wrote: > >> On Thu, Jan 12, 2012 at 10:33 PM, Peter Vandenabeele >> wrote: >> >>> Very speculative ... could you ask it's ancestor tree? >>> >>> Twitter::Error::BadGateway.class >>> >> >> Correction >> >>  Twitter::Error::BadGateway.ancestors >> >> that is ... >> >> Peter > > > Here is the ancestors output: > > greyjewel:Morula atma$ cat test.rb && ruby1.9 test.rb > require "twitter" > puts Twitter::Error::BadGateway.ancestors > [...] > Twitter::Error::BadGateway > Twitter::Error::ServerError > Twitter::Error > StandardError > Exception > Object > Kernel > BasicObject > greyjewel:Morula atma$ > > So my error is "BadGateway" but should I use this like: > > [...] > rescue Exception => (Twitter::Error::BadGateway) > [...] > > I'm not sure where to go from here. (Bottom commenting. Thanks Peter). If you put Twitter::Error::BadGateway it'll treat only this particular error. And there's much more. Look at the ones raised by the twitter gem itself. https://github.com/jnunemaker/twitter/tree/master/lib/twitter/error Abinoam Jr.