Error (gb)

Use this class for managing errors raised while the interpreter is running.

This class is static.

Static properties
Backtrace   Returns a backtrace of the function call stack state when the last error occured.
Class   Returns the class where the last error happened.
Code   Returns the last error code.
Text   Returns the last error message.
Where   Returns a string describing the location of the last error in the source code.

Static methods
Clear   Resets the error code to zero and the error message to NULL.
Propagate   Propagates the current error, i.e. raises it this time to the outer error handler.
Raise   Raises a user-defined error.

Note:
Do not use any of the above Properties to "test" if an error occurred, you must only test ERROR itself.
Property Error.Text will always show the text from the last error but ERROR may be false.

For example...

Try SomeCommand()

' If Error.Text Then  ' THIS IS NOT CORRECT

If Error Then   ' THIS IS CORRECT

  Message.Error(Error.Text)

Endif

See also