-
Notifications
You must be signed in to change notification settings - Fork 2
Exception
The Exception class is the OOP counterpart to the Sheets Exception system.
Exception( string exception_type, data, number level = 1 )level is the level at which to start the stack traceback, and works like Lua error levels.
Exception.name - string
The name of the exception.
Exception.data
The data thrown with the exception.
Exception.trace - table
The table containing the traceback of the exception.
string traceback = Exception:getTraceback( string initial = "", string delimiter = "\n" )Returns a string representation of the traceback, with traces separated by the delimiter given, and beginning with initial.
string fmt = Exception:getDataAndTraceback( number indent = 1 )Returns a string representation of the traceback and data combined. indent will indent the traceback portion.
string e = Exception:tostring()Return a string representation of the exception, including name, data, and traceback.
Exception last = Exception.thrown()Returns the last thrown exception.
function Exception.throw( string name, data, number level = 1 )
function Exception.throw( Exception e )Throws an exception.
function(table) block = Exception.try( function f )Returns a function to be called with a table of catches, so the following syntax is used:
Exception.try (f) {
...
}function(function(Exception)) catch = Exception.catch( string etype )
function(function(Exception)) catch = Exception.catch( Class etype )Returns a function to be called with the handler for the exception type given. Usage:
Exception.try (f) {
Exception.catch (etype) (handler);
}table catch = Exception.default( function handler )Returns a table for use in the block of a try call. Usage:
Exception.try (f) {
Exception.catch (etype) (handler);
Exception.default (handler);
}- Exception
- DynamicValueException
- ExpressionException
- IncorrectConstructorException
- IncorrectParameterException
- ParserException
- ResourceLoadException
- ThreadRuntimeException