I came across some situations where the exceptions thrown
by Watir were not picked up by the rescue. The work around for me was
rescue Exception =>
e
log("Exception in #{getFunctionName()} " + e.message + "\n" + e.backtrace.join("\n"))
return false, e.message
ensure
log("Exception in #{getFunctionName()} " + e.message + "\n" + e.backtrace.join("\n"))
return false, e.message
ensure
Peter Chau
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Kurtz
Sent: Wednesday, July 27, 2005 10:03 AM
To: [email protected]
Subject: RE: [Wtr-general] Script return values
I'm familar with it. I don't
think it would make much of a difference for what I'm doing here. Your code is
exactly equivelant to:
try
rescue => e
puts ("Test failed. Error: " + e)
end
rescue => e
puts ("Test failed. Error: " + e)
end
Daniel
Kurtz
Consultant
Olenick &
Associates
205 W. Wacker
Drive
Suite
2010
Chicago, IL
60606
312-332-0096
From: [EMAIL PROTECTED] on behalf of Chris McMahon
Sent: Wed 7/27/2005 9:32 AM
To: [email protected]
Subject: Re: [Wtr-general] Script return values
Do you know about $!? It holds the last error Ruby
encountered. Instead of
>
rescue
> puts("TEST FAILED.")
>
end
try
rescue
puts ("Test failed.
Error: " + $!)
end
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
