[wtr-general] Re: "On Error Resume Next" - Equal statement in Ruby

2009-02-12 Thread Michael Hwee


This is the same as Exception handling.
begin
 ...
rescue
 ...
end



- Original Message 
From: Prince3105 
To: Watir General 
Sent: Wednesday, February 11, 2009 11:11:36 PM
Subject: [wtr-general] "On Error Resume Next" - Equal statement in Ruby


Hi This is Prince3105,

Fairly newbie to watir, and i am using QTP for a long time, since  a
Vbscripter, i couldn't get all features of Ruby.
In Vbscript we are using one statement "On error Resume Next" and "On
error Goto 0" these two will help us in error handling.

so Experts can you throw some light on my request, please give some
examples about, if any error occurs in a particular code watir should
leave this code and move to next line that process should be
continued  until the err handler got disabled.

Thanks,

Prince3105



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: "On Error Resume Next" - Equal statement in Ruby

2009-02-12 Thread Alex Collins

I do not believe Ruby has a direct equivalent. I think that is a good  
thing. By using such statements you are avoiding and concealing  
errors. You are not handling them.

I'm unsure why you want this? Perhaps you could describe the problem  
you're facing rather than the solution you use in VB?

You may be able to implement something by overiding the raise method.  
you could look to see if anyone has done this before using Google.

You can use ruby's begin clause to guard particular pieces of code  
where you wish to handle exceptions arising.

begin
...
rescue
...
else
...
ensure
...
end



Alex

On 12 Feb 2009, at 07:11, Prince3105  wrote:

>
> Hi This is Prince3105,
>
> Fairly newbie to watir, and i am using QTP for a long time, since  a
> Vbscripter, i couldn't get all features of Ruby.
> In Vbscript we are using one statement "On error Resume Next" and "On
> error Goto 0" these two will help us in error handling.
>
> so Experts can you throw some light on my request, please give some
> examples about, if any error occurs in a particular code watir should
> leave this code and move to next line that process should be
> continued  until the err handler got disabled.
>
> Thanks,
>
> Prince3105
>
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---