Other Responses to an Error
- Last UpdatedFeb 08, 2023
- 1 minute read
After handling an error, you can still output the detail of the error message with the following commands:
$P $!!Error.Text
$P $!!Error.Command
$P $!!Error.Line
do !line VALUES !!Error.Callstack
$P $!Line
enddo
To abandon the running PML Macro or function, but to re-instate the error so that the calling PML code has a chance to handle it, you can use the command:
return error
You can also re-instate the error but suppress the alert using the command:
return error noalert
To generate a new error (or replace an error with your own error) plus an optional message, use one of the following
return error 1
return error 1 ‘Your error message’
return error 1 NOALERT
To handle such an error there is a special form of the handle command:
handle 1
PML code to handle a user-defined error number
endhandle