Exemple #1
0
        private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            try
            {
                Exception ex = e.Exception;

                // If app crashed within 30 seconds, this might be a start up crash.
                // Bring user into console mode
                if (DateTime.Now.Subtract(AppStartTime).TotalSeconds < 30)
                {
                    GR.Config.Properties.CONSOLE_MODE = true;
                    GR.Config.Properties.LAST_ERROR   = ex.Message + "\n" + ex.StackTrace;
                }

                if (NetLog.Enabled && !NetLog.Ended)
                {
                    Logger.Log(ID, ex.Message, LogType.ERROR);
                    Logger.Log(ID, ex.StackTrace, LogType.ERROR);
                    NetLog.FireEndSignal(ex);
                    e.Handled = true;
                }
            }
            catch { }
        }