icbm/src/main/java/dan200/computercraft/api/lua/LuaException.java

33 lines
805 B
Java
Raw Normal View History

2022-11-09 22:15:45 +01:00
/**
* This file is part of the public ComputerCraft API - http://www.computercraft.info
2022-11-09 22:16:55 +01:00
* Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in
* full only. For help using the API, and posting your mods, visit the forums at
* computercraft.info.
2022-11-09 22:15:45 +01:00
*/
package dan200.computercraft.api.lua;
/**
* An exception representing an error in Lua, like that raised by the error() function
*/
2022-11-09 22:16:55 +01:00
public class LuaException extends Exception {
2022-11-09 22:15:45 +01:00
private final int m_level;
2022-11-09 22:16:55 +01:00
public LuaException() {
this("error", 1);
2022-11-09 22:15:45 +01:00
}
2022-11-09 22:16:55 +01:00
public LuaException(String message) {
this(message, 1);
2022-11-09 22:15:45 +01:00
}
2022-11-09 22:16:55 +01:00
public LuaException(String message, int level) {
super(message);
2022-11-09 22:15:45 +01:00
m_level = level;
}
2022-11-09 22:16:55 +01:00
public int getLevel() {
2022-11-09 22:15:45 +01:00
return m_level;
}
}