I don't think there's way to rescue an exception, ignore it and then
continue execution _at the statement following the one that blew up_.
Two alternatives you might consider:
1. Create a method that does the if x.at .. check and call that for
each variable you need assigned. If you really prefer a rescue over
the check the method could do that instead.
2. How many variables are we talking about ? I'd consider more than a
handful of them a code 'smell' and think about using a collection. If
you were looping through a collection then begin/rescue/next would do
what you're talking about above.
Cheers,
lasitha
···
On Fri, Feb 20, 2009 at 3:44 PM, Lin Wj <mailbox.lwj@gmail.com> wrote:
i am using hpricot to parse xml and place it into an object named 'x'
[... ]
if i do a rescue exception , it catches it and thats the end of it , it
stops executing.