Skip to content

FxError ​

This module contains error handling functions. Each error that occurs has a code and a message. For information on the meaning of the error codes, refer to the Error Reference.

Load ​

lua
FxError = require "FxError";

Functions ​

FunctionDescription
Clear ()Clears all errors.
GetCode (Index)Returns error codes.
GetCount ()Returns the number of errors.
GetLastCode ()Returns the most recent error code.
GetLastMessage ()Returns the most recent error message.
GetMessage (Index)Returns error messages.

Clear () ​

This function clears all error codes and messages.

Since ​

Version 1.0

Example ​

lua
FxError.Clear();

GetCode (Index) ​

This function returns the error code at the given index from the list of errors that have occured since the last call to Clear. The first occured error has index 0.

Parameters ​

  • Index: The index of the error

Returns ​

Error code

Since ​

Version 1.0

Example ​

lua
error = FxError.GetCode(1);

GetCount () ​

This function returns the number of errors that have occured since the last call to Clear.

Returns ​

Error count

Since ​

Version 1.0

Example ​

lua
if FxError.GetCount > 0 then
	-- do something
end

GetLastCode () ​

This function returns the most recent error code.

Returns ​

Error code

Since ​

Version 1.0

Example ​

lua
error = FxError.GetLastCode();

GetLastMessage () ​

This function returns the most recent error message.

Returns ​

Error message

Since ​

Version 1.0

Example ​

lua
msg = FxError.GetLastMessage();

GetMessage (Index) ​

This function returns the error message at the given index from the list of errors that have occured since the last call to Clear. The first occured error has the index 0.

Parameters ​

Index: The index of the error

Returns ​

Error message

Since ​

Version 1.0

Example ​

lua
msg = FxError.GetMessage(1);