Пример #1
0
        static int _m_writeLuaDmpToFile_xlua_st_(RealStatePtr L)
        {
            try {
                {
                    string text = LuaAPI.lua_tostring(L, 1);

                    DBOSManager.writeLuaDmpToFile(text);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Пример #2
0
        public void ThrowExceptionFromError(int oldTop)
        {
#if THREAD_SAFT || HOTFIX_ENABLE
            lock (luaEnvLock)
            {
#endif
            object err = translator.GetObject(L, -1);
            LuaAPI.lua_settop(L, oldTop);

            // A pre-wrapped exception - just rethrow it (stack trace of InnerException will be preserved)
            Exception ex = err as Exception;
            if (ex != null)
            {
                // 将错误日志输出到UnityEngine
                //UnityEngine.Debug.LogException(ex);
                DBOSManager.writeLuaDmpToFile(ex.Message);
                throw ex;
            }

            // A non-wrapped Lua error (best interpreted as a string) - wrap it and throw it
            if (err == null)
            {
                err = "Unknown Lua Error";
            }
            ex = new LuaException(err.ToString());

            // 将错误日志输出到UnityEngine
            //UnityEngine.Debug.LogException(ex);
            DBOSManager.writeLuaDmpToFile(ex.Message);

            throw ex;

#if THREAD_SAFT || HOTFIX_ENABLE
        }
#endif
        }