Re: help with exceptions

Frederick Cheung
Wed, 22 Apr 2009 15:34:06 -0000

On Apr 22, 3:52 pm, cutelucks Ms
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
>
> but even when i comment the intial code and start from
''NonExisting''
> line the same output comes. I guess it should now have gone to nameerror
> rite but still the output is
> hello
> nil

Oh, and you rescue clause is wrong too - you''re rescuing all
Exceptions, not just NoMethodErrors (and then it''s probably trying to
assign the exception object to the NoMethodError constant or something
crazy like that). Check whatever ruby reference you''re using for the
correct syntax