| Overview | Module | Function | Class | Tea 3.2.5 Reference Documentation © 2009 PDM&FC |
catch aBlock [aSymbol [aStSymbol]]
Executes a code block and checks if any errors were thrown.
aBlock.
If the execution of a aBlock generates a runtime error
the error is catched and the catch function returns true.
In this case, if the aSymbol argument is specified, the variable
identified by that symbol will be assigned a reference
to a string object representing the message associated with the runtime
error that was generated. Also in this case, if the
aStSymbol argument is specified, the variable
identified by that symbol will be assigned a reference
to a multi-line string object with the error message and a
human readable stack trace representation.
If the execution of aBlock concludes with no error then
the variable identified by aSymbol will receive the
result of the execution of
aBlock. In this case the catch will return
the false boolean value. The result of the execution of a block is
the value returned by the last statement executed inside the block.
If there is no variable identified by aSymbol
or aStSymbol
accessible in the current context then one will be created in the
current context.
| Overview | Module | Function | Class | Tea 3.2.5 Reference Documentation © 2009 PDM&FC |