Gentee Programming Language > Documentation > Syntax Download documentation

Exception handling

Gentee supports throwing and handling exceptions. Taking advantage of exceptions simplifies an error processing. In particular, using exceptions enables us to avoid checking the returned function values for errors.

if myfunc( a )      
{
print( "Error!")
return 0
}

is equivalent to

myfunc( a )

In addition, it would be better to handle a rollback by using exceptions rather than terminate the program abnormally.

 
exceptionException handler definition.
throwThrowing exceptions.
finallyTermination handling.


 Copyright © 2004-2006 Gentee Inc. All rights reserved.