public LuaException(string msg, Exception e = null, int skip = 1) : base(msg) { if (e != null) { if (e is LuaException) { _stack = e.StackTrace; } else { StackTrace trace = new StackTrace(e, true); StringBuilder sb = new StringBuilder(); ExtractFormattedStackTrace(trace, sb); StackTrace self = new StackTrace(skip, true); ExtractFormattedStackTrace(self, sb, trace); _stack = sb.ToString(); } } else { StackTrace self = new StackTrace(skip, true); StringBuilder sb = new StringBuilder(); ExtractFormattedStackTrace(self, sb); _stack = sb.ToString(); } string content = ToString(); //上报错误信息 if (!content.IsNullOrEmpty()) { // #if DEBUG // Debugger.LogException(this); // #endif CustomerUtil.CustomEventCallback("LuaException", content); if (!UnityEngine.Application.isEditor && (GameConfigProject.instance.developmentMode || UnityEngine.Application.platform == RuntimePlatform.WindowsPlayer)) { if (ExceptionShow.Instance == null) { ExceptionShow.IsShowExc = true; new GameObject().AddComponent <ExceptionShow>(); } if (ExceptionShow.IsShowExc) { ExceptionShow.strException += content; } } // BuglyAgent.ReportException(this, "LuaException"); // DCAgent.reportError("LuaException", content); } }
static int QPYX_CustomEventCallback_YXQP(IntPtr L_YXQP) { try { ToLua.CheckArgsCount(L_YXQP, 2); string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1); string QPYX_arg1_YXQP = ToLua.CheckString(L_YXQP, 2); CustomerUtil.CustomEventCallback(QPYX_arg0_YXQP, QPYX_arg1_YXQP); return(0); } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
static int CustomEventCallback(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); string arg0 = ToLua.CheckString(L, 1); string arg1 = ToLua.CheckString(L, 2); CustomerUtil.CustomEventCallback(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }