org.luaj.vm2
Class LuaError

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.luaj.vm2.LuaError
All Implemented Interfaces:
java.io.Serializable

public class LuaError
extends java.lang.RuntimeException

RuntimeException that is thrown and caught in response to a lua error. This error does not indicate any problem with the normal functioning of the Lua VM, but rather indicates that the lua script being interpreted has encountered a lua error, eigher via LuaState.error() or lua error() calls.

See Also:
Serialized Form

Constructor Summary
LuaError(java.lang.String message)
          Construct a LuaError with a specific message indicating a problem within the lua code itself such as an argument type error.
LuaError(java.lang.String message, int level)
           
LuaError(java.lang.Throwable cause)
          Construct a LuaErrorException in response to a Throwable that was caught indicating a problem with the VM rather than the lua code.
 
Method Summary
 java.lang.Throwable getCause()
          Get the cause, if any.
 void printStackTrace()
          Print the message and stack trace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LuaError

public LuaError(java.lang.Throwable cause)
Construct a LuaErrorException in response to a Throwable that was caught indicating a problem with the VM rather than the lua code. All errors generated from lua code should throw LuaError(String) instead.


LuaError

public LuaError(java.lang.String message)
Construct a LuaError with a specific message indicating a problem within the lua code itself such as an argument type error.

Parameters:
message - message to supply

LuaError

public LuaError(java.lang.String message,
                int level)
Parameters:
message - message to supply
level - where to supply line info from in call stack
Method Detail

printStackTrace

public void printStackTrace()
Print the message and stack trace

Overrides:
printStackTrace in class java.lang.Throwable

getCause

public java.lang.Throwable getCause()
Get the cause, if any.

Overrides:
getCause in class java.lang.Throwable


Copyright © 2007-2013 Luaj.org. All Rights Reserved.