Throw an exception with exception information provided as a Uniface list.
throw/list uerror::getInParamSyntaxError("pNameOfInParam", pNameOfInParam, "Not a number")
|ExceptionInfo||String||An associative list with items
After the throw statement, $procerror has the value that was specified in the
ERROR item in the ExceptionInfo argument, and $procerrorcontext has items with IDs
ADDITIONAL, which have the same values as their respective counterparts in the ExceptionInfo argument of the throw/list statement.
If ExceptionInfo does not have:
ERRORitem, $procerrorcontext will have an
ERRORitem with value
DESCRIPTIONitem, $procerrorcontext will have a
DESCRIPTIONitem with value
ADDITIONALitem, $procerrorcontext will not have the
Allowed in all component types.
Like the throw statement, the throw/list statement stops execution of the current block of code.
The throw/list statement enables you to use ProcScript modules that prepare a coherent set of exception-related information for use with the throw statement. For example:
prepare_exception is an entry that prepares a Uniface list with the three exception-related items.
If the throw/list statement is:
- Inside a try...catch...endtry block, code execution continues in one of the associated catch blocks, if there is an applicable one. If not, the exception bubbles up to the next try-level or to the caller of the module.
- Outside a try...catch...endtry block but in a ProcScript module that has the
throwsclause, code execution continues within the calling module, with the statement following the call to this module.
- Outside a try...catch...endtry block, in a ProcScript module that does not have the
throwsclause, the ProcScript compiler returns as error:
error: 1000 - "throw" statement only allowed inside a try block or in a module declared as throws