Page tree
Skip to end of metadata
Go to start of metadata

Exceptions are run-time errors that can be intercepted for "smart" contextual handling (instead of an unexpected error or termination).

Typical format:

Try
   <program code subject to possible exception>
Catch ex As Exception
   <Exception-handling code; here we write to the logfile which displays on the console tab>
   logger.notice ("Error: " + ex.getMessage())
Finally
   <program code>
End Try

 

The Finally block is optional.

As in Java and Groovy, the script can throw its own exception:

Try
   <program code>
Catch ex As Exception
   error(ex.message)
   Throw e
Finally
   <program code>
End Try

 

Make sure the structure is implemented as it is shown here.

 

 

 

  • No labels