public class LuaError extends RuntimeException
LuaError is used wherever a lua call to error()
would be used within a script.
Since it is an unchecked exception inheriting from RuntimeException,
Java method signatures do notdeclare this exception, althoug it can
be thrown on almost any luaj Java operation.
This is analagous to the fact that any lua script can throw a lua error at any time.
The LuaError may be constructed with a message object, in which case the message is the string representation of that object. getMessageObject will get the object supplied at construct time, or a LuaString containing the message of an object was not supplied.
| 限定符和类型 | 字段和说明 |
|---|---|
protected Throwable |
cause |
protected String |
fileline |
protected int |
level |
protected String |
traceback |
protected String |
varname |
| 构造器和说明 |
|---|
LuaError(LuaValue message_object)
Construct a LuaError with a LuaValue as the message object,
and level to draw line number information from.
|
LuaError(String message)
Construct a LuaError with a specific message.
|
LuaError(String message,
int level)
Construct a LuaError with a message, and level to draw line number information from.
|
LuaError(Throwable cause)
Construct LuaError when a program exception occurs.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Throwable |
getCause()
Get the cause, if any.
|
String |
getMessage()
Get the string message if it was supplied, or a string
representation of the message object if that was supplied.
|
LuaValue |
getMessageObject()
Get the LuaValue that was provided in the constructor, or
a LuaString containing the message if it was a string error argument.
|
protected int level
protected String fileline
protected String varname
protected String traceback
protected Throwable cause
public LuaError(Throwable cause)
All errors generated from lua code should throw LuaError(String) instead.
cause - the Throwable that caused the error, if known.public LuaError(String message)
message - message to supplypublic LuaError(String message, int level)
message - message to supplylevel - where to supply line info from in call stackpublic LuaError(LuaValue message_object)
message_object - message string or object to supplypublic String getMessage()
getMessage 在类中 Throwablepublic LuaValue getMessageObject()
Copyright © 2020. All rights reserved.