xpxThrow
PROCEDURE xpxThrow (returnValue : GENERIC; errCode : INTEGER; userErrCode : INTEGER; lineNumber : INTEGER; errMessage : STRING; userErrMessage : STRING; functionName : STRING);
The xpxThrow function throws an exception that will be caught by the current ON_ERROR_DO in scope. The global instance xpxExceptionId will be populated with the arguments given in xpxThrow. It is possible to omit arguments, i.e. all arguments are optional. Exception attributes that correspond to omitted arguments will be propagated unchanged . The execution of the xpxThrow function will have no effect other than assigning the supplied arguments to the global xpxExceptionId instance, when no ON_ERROR_DO block is in scope of the xpxThrow call. When an xpxThrow function is called within an ON_ERROR_DO block, the execution will be resumed in the calling function (previous function/procedure on the stack) in one of the two places:
- When an ON_ERROR_DO block is in scope in the actual call in the previous function/procedure, the execution will be resumed at the start of this exception handler in scope. This exception handler can get more information about the exception by reading the attributes of the xpxExceptionId instance.
- When no ON_ERROR_DO block is in scope in the actual call in the previous function/procedure, the execution will be resumed in the statement immediately after the call to the current function/procedure. When the calling declaration is a function the function value of the current function will be set to the attribute value xpxExceptionId.returnValue that is the same value as the returnValue argument in the xpxThrow call.
- If xpxThrow() imposes termination of EDMexpressVM and return to EDMI, typically in an ON_ERROR_DO block in a query function, return status from VM will be set to xpxExceptionId.errCode
Arguments
Type | Name | Comment |
GENERIC | returnValue | The value that will be returned from the function in which the throw has been invoked. This attribute has relevance in case the calling scope has no catch block (ON_ERROR_DO). |
INTEGER | errCode | XPX/EDMI error code |
INTEGER | userCode | User defined error code. |
INTEGER | lineNumber | Line number which indicates were the exception was raised. |
STRING | errMessage | XPX/EDMI error message. |
STRING | userMessage | User defined error message. |
STRING | functionName | Function name which indicates where the exception was raised. |
Return Value
Options
Example
<Missing Example>
See also
Filter by label
There are no items with the selected labels at this time.