Beispiel #1
0
        private void CurrentDomain_FirstChanceException(object sender, FirstChanceExceptionEventArgs e)
        {
            String hash = e.ToString().GetHashCode().ToString();

            Console.WriteLine("UNHANDLED EXCEPTION (4) (Code: " + hash + ") : " +
                              e.Exception.ToString());
        }
 private void CurrentDomain_FirstChanceException(object sender, FirstChanceExceptionEventArgs e)
 {
     if (Utilities.FastCRC32.CRC32String(e.ToString()) != 1532817726)
     {
         logFile.WriteLine("UNHANDLED EXCEPTION (4) (Hash: " + Utilities.FastCRC32.CRC32String(e.ToString()) + ") : " +
                           e.Exception.ToString());
     }
 }
Beispiel #3
0
        static void CurrentDomain_FirstChanceException(object sender, FirstChanceExceptionEventArgs e)
        {
            var ee = e.Exception as Exception;

            string str = ExceptionHelper.GetExceptionMsg(ee, e.ToString());

            LogManager.yc全局异常.Error(str);
        }
Beispiel #4
0
 public static void CurrentDomain_FirstChanceException(object sender, FirstChanceExceptionEventArgs e)
 {
     if (e.Exception is InvalidCastException || e.Exception is System.Collections.Generic.KeyNotFoundException)
     {
         return;
     }
     WriteToLog.Log("A first chance exception was thrown", "EXCEPTION");
     WriteToLog.Log(e.Exception.Message, "EXCEPTION");
     WriteToLog.Log(e.ToString(), "EXCEPTION");
 }
Beispiel #5
0
        public void CurrentDomain_FirstChanceException(object sender, FirstChanceExceptionEventArgs e)
        {
            if (e.Exception is InvalidCastException || e.Exception is KeyNotFoundException)
            {
                return;
            }

            _logWriter.Log("A first chance exception was thrown", "EXCEPTION");
            _logWriter.Log(e.Exception.Message, "EXCEPTION");
            _logWriter.Log(e.ToString(), "EXCEPTION");
            _logWriter.Log(e.Exception.StackTrace, "EXCEPTION");
        }
 private static void HandleFirstChanceException(object sender, FirstChanceExceptionEventArgs e)
 {
     AppDomain.CurrentDomain.FirstChanceException -= HandleFirstChanceException;
     try
     {
         Logger.Warn(e.ToString(), e.Exception);
     }
     catch (IOException)
     {
     }
     finally
     {
         AppDomain.CurrentDomain.FirstChanceException += HandleFirstChanceException;
     }
 }