Project/06 - External/KopiLuaInterface/src/Lua.cs
/// <summary>
/// Assuming we have a Lua error string sitting on the stack, throw a C# exception out to the user's app
/// </summary>
Assuming we have a Lua error string sitting on the stack, throw a C# exception out to the user's app
Assuming we have a Lua error string sitting on the stack throw a C# exception out to the user ' s app
void ThrowExceptionFromError(int oldTop)
        {
            object err = translator.getObject(luaState, -1);
            LuaDll.lua_settop(luaState, oldTop);
            Exception thrown = err as Exception;
            if (thrown == null)
            {
                if (err == null)
                    err = "Unknown Lua Error";
                thrown = new LuaException(err.ToString());
            }
            throw thrown;
        }
void ThrowExceptionFromError ( int oldTop ) { object err = translator . getObject ( luaState , - 1 ) ; LuaDll . lua_settop ( luaState , oldTop ) ; Exception thrown = err as Exception ; if ( thrown == null ) { if ( err == null ) err = " " ; thrown = new LuaException ( err . ToString ( ) ) ; } throw thrown ; }
Assuming we have a Lua error string sitting on the stack, throw a C# exception out to the user's app
Assuming we have a Lua error string sitting on the stack throw a C# exception out to the user ' s app
// If the 'error' on the stack is an actual C# exception, just rethrow it.  Otherwise the value must have started // as a true Lua error and is best interpreted as a string - wrap it in a LuaException and rethrow.
oldTop
int