M
mirth
hi guys,
I'm a ruby newbie. I have a question about how to continuethe loop
after the exception. If anyone here could help me, I really appreciate
that.
example:
I have two methods:
def looptest
"do sth"
rescue
"do sth"
end
def test_01
somearray.each{|obj|
looptest
}
end
Right now if there's an exception in looptest, it will exit the loop.
But I want the loop in test_01 to continue the next one even if
there's an exception for the looptest in the previous loop. Is there
anyway to achieve this? I tried "continue", "return","break" and etc.
But nothing works so far.
I'm a ruby newbie. I have a question about how to continuethe loop
after the exception. If anyone here could help me, I really appreciate
that.
example:
I have two methods:
def looptest
"do sth"
rescue
"do sth"
end
def test_01
somearray.each{|obj|
looptest
}
end
Right now if there's an exception in looptest, it will exit the loop.
But I want the loop in test_01 to continue the next one even if
there's an exception for the looptest in the previous loop. Is there
anyway to achieve this? I tried "continue", "return","break" and etc.
But nothing works so far.