This module provides the handling of errors.
The aoterr_*
constants are used to identify specific kinds of errors
that might appear when attempting to obtain a value from the Lua script.
The aot_err_handler provides access to error messages that might be issued by Lua itself for routines in the Lua API that return an error code.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | aoterr_Fatal | = | 0 | Indication of a a fatal error if this bit is set in an error code. |
integer, | public, | parameter | :: | aoterr_NonExistent | = | 1 | Indication that the requested value does not exist in the Lua script if this bit is set in an error code. |
integer, | public, | parameter | :: | aoterr_WrongType | = | 2 | Indication that a requested value exists in the Lua script but has the wrong data type. |
Error handler to capture Lua errors.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L | Handle to the Lua script |
|||
integer, | intent(in) | :: | err | Lua error code to evaluate |
||
character(len=*), | intent(in) | :: | msg | Some additional message that should be prepended to the Lua error message if the program is stopped by the handler (no ErrString or ErrCode provided). |
||
character(len=*), | intent(out), | optional | :: | ErrString | Resulting error string obtained by combining msg and the error description on the Lua stack. |
|
integer, | intent(out), | optional | :: | ErrCode | The Lua error code, just the same as err. |