What is the use of catch in escript?

Showing Answers 1 - 6 of 6 Answers

Sasi Kiran

  • May 17th, 2005
 

The catch clause is used to handle the exception. To raise an exception, use the throw statement. 
When you want to trap potential errors generated by a block of code, place that code in a try 
statement, and follow the try statement with a catch statement. The catch statement is used to 
process the exceptions that may occur in the manner you specify in the exception_handling_block. 
The following example demonstrates the general form of the try statement with the catch clause. In 
this example, the script continues executing after the error message is displayed: 
try 

do_something; 

catch( e ) 

TheApplication().RaiseErrorText(Clib.rsprintf( 
"Something bad happened: %s
",e.toString())); 
}

  Was this answer useful?  Yes

S.Ramesh

  • Aug 30th, 2006
 

Hi

Try statement for do some process carried out. If anything happen wrongly in the try statement then exception will raise through Catch statment.

Regards

S.Ramesh

  Was this answer useful?  Yes

aymox

  • Jan 5th, 2007
 

Hi

you use "try catch" statement to handle a block of code for which you are not sure about the result and you want to avoid interrupting the execution of your entire script.

good luck

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions