Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
RealityV15.1Online Documentation (MoTW) Revision 7
ETHROW Statement (dbasic_exception_hndlr_ethrow.htm)
The DataBasic ETHROW statement is used to generate a user exception. ETHROW transfers control to the label most recently identified by an ECATCH statement which may have occurred in calling code higher up the return stack
ETHROW n {, exception message}
n | The non-zero exception number. The allowed range of user exception numbers is 1 – 9999. If the specified number is outside this range, a fatal runtime error B66 will occur. (System generated exceptions use numbers above 9999.) |
exception message |
An optional string containing the exception message. It can be multi-valued. |
On execution of the ETHROW statement, control will be transferred to the label most recently identified by an ECATCH statement, which may have occurred in calling code earlier in the call stack.
If no exception catch label has been defined within this or an earlier code level, a fatal runtime error B64 will occur.
A valid ETHROW statement, when used with a defined catch label, will save the specified exception number and optional exception message for use by the EXCEPT.NUM() and EXCEPT.MSG() functions. In addition, the system will also save the current location and code level return stack information for use by the EXCEPT.STK() function.
Any subsequent exceptions will overwrite the saved exception information before transferring control to any active exception catch labels defined at this or earlier code levels.