Class LuaException

java.lang.Object
java.lang.Throwable
java.lang.Exception
dan200.computercraft.api.lua.LuaException
All Implemented Interfaces:
Serializable

public class LuaException extends Exception
An exception representing an error in Lua, like that raised by the error() function.
See Also:
  • Constructor Details

    • LuaException

      public LuaException(@Nullable String message)
    • LuaException

      public LuaException(@Nullable String message, int level)
  • 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.