Page Status: Beta
Represents a generic error that can be thrown, then caught in an error handler. There are two kinds of error handlers: a catch block on a function call, and an OnError block at the end of a statement block. The Error class can be sub-classed for more specific, user-defined errors. Error handlers always receive an object whose class inherits from this generic class.
A catch block can be added to a function call by clicking the Handle OnError checkbox in the Property Editor. An OnError block can be added to a statement block by dragging an OnError statement into the code editor.
Back to Runtime Types
Inherits From
root→Object→Error
Fields
| string actionType |
Type of action to take when the handler finishes. The possibilities are "return", "not-handled", "retry", "continue", and "abort". The default value is "not-handled", which means that the error will be re-thrown.
- “return” means that the function containing this error handler returns to its caller as soon as the catch/OnError block is done. This skips over any pending statements remaining “between” the throw point and the catch point. The skipped-over statements may include statements in the current block, in a function called by this block, in a function called by that function, etc., up to the point where the error was thrown.
- “not-handled” means that the same error is thrown again. The execution stack is scanned backwards to find the nearest enclosing handler, and execution restarts there.
- “retry” means that execution is restarted at the statement that caused the error -- the failing statement is attempted again. All pending statements in functions “between” the point of the throw and this handler will run to completion (unless another throw prevents them from doing so).<o:p></o:p>
- “continue” means that when the handler finishes executing, execution continues with the next statement following the handler. For a catch statement, that would be the statement following the function call it’s attached to. For an OnError statement, that would be the statement following the block of statements guarded by the OnError (for example, for an OnError guarding the top-level statement list of a function, that would be equivalent to a return; for an OnError at the end of a case-block, that would be the statement following the containing conditional statement).
- "abort" means that when the handler finishes executing, the thread executing the handler will be terminated.
|
| string actor |
The function that was being processed when the error occurred. |
| string code |
The error code associated with the error (user specified). |
| string detail |
More detailed information about the error (where, why, etc.), displayed when the error occurs. |
| string message |
The message displayed when the error occurs. |
Function Summary
Function Detail
onError(Override)
function description
Syntax
onError( [in] Error error )
Parameters
- error
- argument description