Joel VanderWerf
4/2/2008 1:26:00 AM
Jeff Miller wrote:
> Hello,
> I have an exception statement that needs to loop if it fails...
> something like this:
>
> begin
> contacts_folder = session.GetDefaultFolder(5)
> rescue Exception
> (GO BACK AND TRY AGAIN)
> else
> blah blah blah
> end
>
> any suggestions?
Easy, use retry:
begin
contacts_folder = session.GetDefaultFolder(5)
rescue Exception => ex
puts ex
unless $tried
$tried = true
retry
end
end
__END__
Output:
undefined local variable or method `session' for main:Object
undefined local variable or method `session' for main:Object
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407