Command group | Flag affected | Reversible | Execute on client | Platform(s) |
---|---|---|---|---|
Error handlers | NO | NO | NO | All |
Signal error {error-number, error-text (e.g. 5, 'Error 5 occurred')}
This command reports a fatal error which can be either a user-defined error or a built-in Omnis error. A fatal error is any error that normally halts method execution and reports an error (for example, syntax error, or an out of memory error). Built-in Omnis errors are reported in #ERRCODE and #ERRTEXT, the latter is limited to 255 characters.
The fatal error is reported with the specified error code and text. Any error handler for that code will be invoked. If there is no error handler or the error handler does not make a set error action (SEA), the debugger is invoked, if available. Otherwise, execution halts with the error message.
This command is useful for trapping user-defined errors, and is a convenient tool for triggering an error situation inside Omnis for whatever condition you may want to specify.
Test for only one user
If flag false
Signal error {99,'Test for one user failed'}
End If