コード例 #1
0
        static void ExceptionHandler(object sender, UnhandledExceptionEventArgs args)
        {
            int       result = unchecked ((int)LinqToDryadException.E_FAIL);
            Exception e      = args.ExceptionObject as Exception;

            if (e != null)
            {
                result = System.Runtime.InteropServices.Marshal.GetHRForException(e);
                DryadLogger.LogCritical(0, e);
            }
            DebugHelper.StopLogging(result);

            if (Debugger.IsAttached)
            {
                Debugger.Break();
            }
            else
            {
                DrLogging.WriteMiniDump();
            }

            // We need to Exit, since other threads in the GM
            // are likely to still be running.
            Environment.Exit(result);
        }
コード例 #2
0
        static void ExceptionHandler(object sender, UnhandledExceptionEventArgs args)
        {
            int       result      = unchecked ((int)LinqToDryadException.E_FAIL);
            Exception e           = args.ExceptionObject as Exception;
            string    errorString = "Unknown exception";

            if (e != null)
            {
                result      = System.Runtime.InteropServices.Marshal.GetHRForException(e);
                errorString = e.ToString();
                DryadLogger.LogCritical(errorString);
                System.Threading.Thread.Sleep(10 * 1000);
            }
            DebugHelper.StopLogging(result, errorString, DateTime.Now.ToLocalTime(), dfsDirectory);

            if (Debugger.IsAttached)
            {
                Debugger.Break();
            }
            else
            {
                DrLogging.WriteMiniDump();
            }

            // We need to Exit, since other threads in the GM
            // are likely to still be running.
            Environment.Exit(result);
        }