Ejemplo n.º 1
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine(e.ToString());
            _Log.Fatal(e.ToString());

            Console.ReadLine();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// </summary>
 /// <param name="sender"> </param>
 /// <param name="e"> </param>
 protected virtual void AppDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     #if !DEBUG
     Trace.WriteLine(e.ToString());
     #else
     Debug.WriteLine(e.ToString());
     #endif
 }
Ejemplo n.º 3
0
 public void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (e.IsTerminating)
     {
         Fatal("Application Fatal!", new Exception(string.Format("Exception Object:{0} UnhandledExceptionEventArgs:{1}",e.ExceptionObject.ToString(),e.ToString())));
     }
     else
     {
         Error("Application Error!", new Exception(string.Format("Exception Object:{0} UnhandledExceptionEventArgs:{1}", e.ExceptionObject.ToString(), e.ToString())));
     }
 }
Ejemplo n.º 4
0
 private static void AppDomain_UnHandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     if (e.ExceptionObject is System.Exception)
     {
         Log.WriteLog(DateTime.Now + " 系统异常\r\n" + e.ToString() + "\r\n");
     }
 }
Ejemplo n.º 5
0
 private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
     Loger.Error(str);
     //MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     //LogManager.WriteLog(str);
 }
 private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (!(e.ExceptionObject is ThreadAbortException))
     {
         System.Diagnostics.EventLog.WriteEntry("low-level-sendkeys", "Unhandled Exception at socket-server: " + e.ToString());
     }
 }
Ejemplo n.º 7
0
        static void UnhandledException(object sender, UnhandledExceptionEventArgs exception)
        {
            string logfile = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\logfile.txt";

            StreamWriter writer = new StreamWriter(logfile, true);
            writer.WriteLine(DateTime.Now.ToString() + " Main Application Bombed - " + exception.ToString());
            writer.Close();
        }
Ejemplo n.º 8
0
        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
            //MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);

            if (_sendErrorEmail)
                UserUtils.SendEmail("错误日志", str);
            //LogManager.WriteLog(str);
            log.Error(str);
        }
Ejemplo n.º 9
0
        static void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e)
        {
            try
            {
                ComForm.InsertErrLog("ExceptionObject" + e.ExceptionObject + "," + e.ToString(), "ERROR");
            }
            catch
            {

            }
        }
Ejemplo n.º 10
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (!Globals.IsSilentInstall) {
         MessageBox.Show(((Exception)e.ExceptionObject).ToString());
     } else {
         Globals.SilentInstallCommunicationPipeStream.WriteString("[Error]" + e.ToString());
         Globals.SilentInstallCommunicationPipe.WaitForPipeDrain();
         Globals.SilentInstallCommunicationPipe.Close();
         System.Environment.Exit(0);
     }
 }
Ejemplo n.º 11
0
 private async void CurrentDomain_UnhandledExceptionAsync(object sender, System.UnhandledExceptionEventArgs e)
 {
     //TODO: 保存用户数据
     await new ContentDialog
     {
         Title           = "Error Occored",
         Content         = e.ToString(),
         CloseButtonText = "Closed",
         DefaultButton   = ContentDialogButton.Close
     }.ShowAsync();
     // throw new NotImplementedException();
 }
Ejemplo n.º 12
0
        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            string str = "";
            Exception error = e.ExceptionObject as Exception;
            if (error != null)
                str = string.Format("UnhandledException:{0};\n\r堆栈信息:{1}", error.Message, error.StackTrace);
            else
                str = string.Format("Application UnhandledError:{0}", e);

            Common.WriteLogFile("未知异常:" + str);
            MessageBox.Show("未知异常,请联系作者:"+e.ToString());
        }
Ejemplo n.º 13
0
        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Debugger.Instance.logMessage("APP DOMAIN CRASH ", e.ToString());

            StackTrace trace = new StackTrace(true);

            for (int i = 0; i < trace.FrameCount; i++)
            {
                StackFrame sf = trace.GetFrame(i);
                Debugger.Instance.logMessage("High up the call stack, Method: ",  sf.GetMethod().ToString());
                Debugger.Instance.logMessage("High up the call stack, Method: ", sf.GetFileLineNumber().ToString());
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// This method is used to trap unhanded exceptions in the service and log them before the service closes.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The exception arguments.</param>
        void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            if (e == null)
            {
                EventLog.WriteEntry(this.ServiceName, "SERVICE CRASH - no data was passed.", EventLogEntryType.Error);
                return;
            }
                      
            Exception ex = e.ExceptionObject as Exception;
            if (ex == null)
            {
                EventLog.WriteEntry(this.ServiceName, 
                    "SERVICE CRASH THE FOLLOWING ERROR CAUSED THE SERVICE TO FAIL: " 
                    + e.ToString(), EventLogEntryType.Error);
                return;
            }

            EventLog.WriteEntry(this.ServiceName, 
                "SERVICE CRASH THE FOLLOWING ERROR CAUSED THE SERVICE TO FAIL: " + ex.Message
                + Environment.NewLine + Environment.NewLine + ex.ToString(), EventLogEntryType.Error);
        }
Ejemplo n.º 15
0
        public static void UnhandledException(object sender, UnhandledExceptionEventArgs ex)
        {
            string logPath = Environment.GetCommandLineArgs()[0] + ".log";

            if (!File.Exists(logPath))
            {
                File.AppendText(logPath);
            }
            StreamWriter logFile = new StreamWriter(logPath, true);
            logFile.WriteLine();
            logFile.WriteLine();
            logFile.WriteLine();
            logFile.WriteLine("-----------------------------------------");
            logFile.WriteLine("System Environment is " + System.Environment.OSVersion.Platform + " With " + System.Environment.ProcessorCount + " Logical Cores");
            logFile.WriteLine("Application Arguments were " + Environment.GetCommandLineArgs());
            logFile.WriteLine("Exception occurred at {0}", DateTime.Now.ToString());
            logFile.WriteLine("-----------------------------------------");
            logFile.WriteLine(ex.ToString());
            logFile.WriteLine("-----------------------------------------");
            logFile.Flush();
            logFile.Close();
        }
Ejemplo n.º 16
0
 void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     logger.Trace(e.ToString());
 }
Ejemplo n.º 17
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     log.Fatal(e.ToString());
 }
Ejemplo n.º 18
0
 public void ThreadExceptionHandle(object sender, UnhandledExceptionEventArgs t)
 {
     // exception
     Core.ExceptionHandler(new Exception("PANIC:" + t.ToString()), true);
 }
Ejemplo n.º 19
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     e.ToString();
     //System.Diagnostics.Debugger.Break();
 }
Ejemplo n.º 20
0
		static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
		{
			Exception ex;
			if(e.ExceptionObject is Exception)
				ex = (Exception)e.ExceptionObject;
			else
				ex = new Exception(e.ToString());
			
			General.ErrorMessage = ex.GetType().Name + ": " + ex.Message + "\r\n" + ex.StackTrace;
			General.WriteLogLine(General.ErrorMessage);
			mainwindow.ShowTaggedPanel("error");
		}
Ejemplo n.º 21
0
		static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
		{
			MessageBox.Show("An unhandled exception occured: " + e.ToString());
		}
Ejemplo n.º 22
0
		void ApplicationUnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
		{
			// When a background thread crashes this is the code that will be executed. You can
			// recover from this.
			// You might for example:
			//  _CurrentActivity.RunOnUiThread(() => Toast.MakeText(_CurrentActivity, "Unhadled Exception was thrown", ToastLength.Short).Show());
			// 
			// or
			//
			// _CurrentActivity.StartActivity(typeof(SomeClass));
			// _CurrentActivity.Finish();
			//
			// It is up to the developer as to what he/she wants to do here.
			//
			// If you are requiring a minimum version less than API 14, you would have to set _CurrentActivity in each time
			// a different activity is brought to the foreground.

			// Send the Exception to TestFlight.
			//			TestFlight.SendCrash(e.ToString());

			throw new System.Exception(e.ToString());
		}
Ejemplo n.º 23
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     AppLog.DebugException(new Exception(e.ToString()));
 }
Ejemplo n.º 24
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Console.WriteLine(e.ToString());
 }
Ejemplo n.º 25
0
 private static void UEEHandler(object sender, UnhandledExceptionEventArgs args)
 {
     Exception e = (Exception)args.ExceptionObject;
     Console.WriteLine(string.Format("Unhandled Exception Event caught : " + e.Message + "," + e.ToString() + "\n" + e.StackTrace.ToString()));
     Console.WriteLine(string.Format("Runtime terminating: {0}, {1}", args.IsTerminating, args.ToString()));
 }
Ejemplo n.º 26
0
        private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself

        /// <summary>
        /// Global exception handler -- all unhandlet exceptions end up here :)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            if (_IsHandlingException)
            {
                return;
            }

            _IsHandlingException = true;
            // TODO: Add config option to allow users to turn off error reporting
            // TODO: Post error report (disabled for now)

            string msg = String.Empty;
            msg += "\r\n";
            msg += "APPLICATION EXCEPTION DETECTED: " + e.ToString() + "\r\n";
            msg += "\r\n";

            msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n";
            Exception ex = (Exception) e.ExceptionObject;
            if (ex.InnerException != null)
            {
                msg += "InnerException: " + ex.InnerException.ToString() + "\r\n";
            }

            msg += "\r\n";
            msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n";

            m_log.ErrorFormat("[APPLICATION]: {0}", msg);

            if (m_saveCrashDumps)
            {
                // Log exception to disk
                try
                {
                    if (!Directory.Exists(m_crashDir))
                    {
                        Directory.CreateDirectory(m_crashDir);
                    }
                    string log = Util.GetUniqueFilename(ex.GetType() + ".txt");
                    using (StreamWriter m_crashLog = new StreamWriter(Path.Combine(m_crashDir, log)))
                    {
                        m_crashLog.WriteLine(msg);
                    }

                    File.Copy("OpenSim.ini", Path.Combine(m_crashDir, log + "_OpenSim.ini"), true);
                }
                catch (Exception e2)
                {
                    m_log.ErrorFormat("[CRASH LOGGER CRASHED]: {0}", e2);
                }
            }

            _IsHandlingException = false;
        }
Ejemplo n.º 27
0
        private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself

        /// <summary>
        /// Global exception handler -- all unhandlet exceptions end up here :)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            if (_IsHandlingException)
                return;

            _IsHandlingException = true;

            string msg = String.Empty;
            msg += "\r\n";
            msg += "APPLICATION EXCEPTION DETECTED: " + e.ToString() + "\r\n";
            msg += "\r\n";

            msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n";
            Exception ex = (Exception)e.ExceptionObject;
            if (ex.InnerException != null)
            {
                msg += "InnerException: " + ex.InnerException.ToString() + "\r\n";
            }

            msg += "\r\n";
            msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n";

            m_log.ErrorFormat("[APPLICATION]: {0}", msg);

            handleException(msg, ex);

            _IsHandlingException = false;
        }
Ejemplo n.º 28
0
 /// <summary>
 /// A handler for all uncaught exceptions. We log, but we'll still die
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 void LogUnhandledException(object sender, UnhandledExceptionEventArgs args)
 {
     Exception e = (Exception)args.ExceptionObject;
     logger.Log("Got unhandled exception from {0}: {1}\nException: {2}", sender.ToString(), args.ToString(), e.ToString());
 }
Ejemplo n.º 29
0
 static void UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     ///handle unhandled excetption here (log, send to a server ....)
     Console.WriteLine("Exception: " + e.ToString());
 }
Ejemplo n.º 30
0
 static void BotClient_GetUpdatesError(object sender, UnhandledExceptionEventArgs e)
 {
     StLog.DebugWriteLine (e.ToString (), "BotClient_GetUpdatesError()");
     ConnectBot ("BotClient_GetUpdatesError");
 }
Ejemplo n.º 31
0
 void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine(e.ToString());
 }
Ejemplo n.º 32
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     Debug.Assert(false, e.ToString());
 }