Package dan200.computercraft.api.lua
Class LuaException
java.lang.Object
java.lang.Throwable
java.lang.Exception
dan200.computercraft.api.lua.LuaException
- All Implemented Interfaces:
Serializable
An exception representing an error in Lua, like that raised by the
error()
function.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLuaException
(@Nullable String message) LuaException
(@Nullable String message, int level) -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LuaException
-
LuaException
-
-
Method Details
-
hasLevel
public boolean hasLevel()Whether a level was explicitly specified when constructing. If a level is not provided, the Lua runtime may attempt to pick the most suitable one.- Returns:
- Whether this has an explicit level.
-
getLevel
public int getLevel()The level this error is raised at. Level 1 is the function's caller, level 2 is that function's caller, and so on.- Returns:
- The level to raise the error at.
-