Ejemplo n.º 1
1
 private static void CurrentDomain_UnhandledException(Object sender, UnhandledExceptionEventArgs e)
 {
     if (e != null && e.ExceptionObject != null)
     {
         log.Error("Error: " + e.ExceptionObject);
     }
 }
Ejemplo n.º 2
0
        private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Exception error = e.ExceptionObject as Exception;

            string errorMessage = string.Format("An unhandled exception occurred: {0}", error);
            MessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
        }
Ejemplo n.º 3
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     string strException = string.Format("{0}发生系统异常。\r\n{1}\r\n", DateTime.Now, e.ExceptionObject.ToString());
     StreamWriter sWriter = new StreamWriter(Path.GetDirectoryName(Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName) + @"\exception.log");
     sWriter.WriteLine(strException);
     sWriter.Close();
 }
Ejemplo n.º 4
0
 private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     var exc = e.ExceptionObject as Exception;
     Logger.LogError(exc, "UNHANDLED EXCEPTION!");
     if (e.ExceptionObject != null && !(e.ExceptionObject is Exception))
         Logger.LogDebug(e.ExceptionObject.ToString());
 }
Ejemplo n.º 5
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (e != null && e.ExceptionObject != null)
     {
         log.Error(m => m("[Program] UnhandledException:{0}", e.ExceptionObject.ToString()));
     }
 }
Ejemplo n.º 6
0
    static private void _OnUnresolvedExceptionHandler(object sender, System.UnhandledExceptionEventArgs args)
    {
#if (UNITY_ANDROID && !UNITY_EDITOR) || FORCE_DEBUG
        if (mCrittercismsPlugin == null || _IsPluginInited == false)
        {
            return;
        }
        if (args == null || args.ExceptionObject == null)
        {
            return;
        }
        if (args.ExceptionObject.GetType() != typeof(System.Exception))
        {
            return;
        }

        try
        {
            System.Exception e = (System.Exception)args.ExceptionObject;
            if (args.IsTerminating)
            {
                mCrittercismsPlugin.CallStatic("LogUnhandledException", e.Source, e.Message, e.StackTrace);
            }
            else
            {
                LogHandledException(e);
            }
        }catch (System.Exception e) { CLog(e.Message); }
#endif
    }
Ejemplo n.º 7
0
        private static void HandleAppDomainException(object sender, UnhandledExceptionEventArgs e)
        {
            var exception = e.ExceptionObject as Exception;

            if (exception == null) return;

            if (exception is NullReferenceException &&
                exception.ToString().Contains("Microsoft.AspNet.SignalR.Transports.TransportHeartbeat.ProcessServerCommand"))
            {
                Logger.Warn("SignalR Heartbeat interupted");
                return;
            }

            if (OsInfo.IsMonoRuntime)
            {
                if (exception is TypeInitializationException && exception.InnerException is DllNotFoundException ||
                    exception is DllNotFoundException)
                {
                    Logger.DebugException("Minor Fail: " + exception.Message, exception);
                    return;
                }
            }

            Console.WriteLine("EPIC FAIL: {0}", exception);
            Logger.FatalException("EPIC FAIL: " + exception.Message, exception);
        }
Ejemplo n.º 8
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Exception ex = e.ExceptionObject as Exception;
     MessageBox.Show(ex.Message, "An unexpected error occurred",
         MessageBoxButtons.OK, MessageBoxIcon.Error);
     Application.Exit();
 }
Ejemplo n.º 9
0
        private static void HandleUnhandledException(object sender, UnhandledExceptionEventArgs evtargs)
        {
            StringBuilder errmsg = new StringBuilder();
            Exception e = evtargs.ExceptionObject as Exception;
            if (e == null)
            {
                errmsg.Append(Convert.ToString(evtargs.ExceptionObject));
            }
            else if (e is ReflectionTypeLoadException)
            {
                ReflectionTypeLoadException rtle = (ReflectionTypeLoadException)e;
                errmsg.AppendLine(rtle.Message);
                errmsg.AppendLine();
                foreach (Exception loaderException in rtle.LoaderExceptions)
                    errmsg.AppendLine(loaderException.Message);
            }
            else
            {
                errmsg.Append(e.Message);
                if (e.InnerException != null)
                {
                    errmsg.AppendLine();
                    errmsg.Append(e.InnerException.Message);
                }
            }

            ErrorFrm errfrm = new ErrorFrm() { ErrorMessage = errmsg.ToString() };
            errfrm.ShowDialog();
        }
Ejemplo n.º 10
0
        static void UnhandledException( object sender, UnhandledExceptionEventArgs e )
        {
            // So we don't get the normal unhelpful crash dialog on Windows.
            Exception ex = (Exception)e.ExceptionObject;
            string error = ex.GetType().FullName + ": " + ex.Message + Environment.NewLine + ex.StackTrace;
            bool wroteToCrashLog = true;
            try {
                using( StreamWriter writer = new StreamWriter( crashFile, true ) ) {
                    writer.WriteLine( "--- crash occurred ---" );
                    writer.WriteLine( "Time: " + DateTime.Now.ToString() );
                    writer.WriteLine( error );
                    writer.WriteLine();
                }
            } catch( Exception ) {
                wroteToCrashLog = false;
            }

            string message = wroteToCrashLog ?
                "The cause of the crash has been logged to \"" + crashFile + "\". Please consider reporting the crash " +
                "(and the circumstances that caused it) to github.com/UnknownShadow200/ClassicalSharp/issues" :

                "Failed to write the cause of the crash to \"" + crashFile + "\". Please consider reporting the crash " +
                "(and the circumstances that caused it) to github.com/UnknownShadow200/ClassicalSharp/issues" +
                Environment.NewLine + Environment.NewLine + error;

            MessageBox.Show( "Oh dear. ClassicalSharp has crashed." + Environment.NewLine +
                            Environment.NewLine + message, "ClassicalSharp has crashed" );
            Environment.Exit( 1 );
        }
Ejemplo n.º 11
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (e.ExceptionObject is Exception)
         HandleException(e.ExceptionObject as Exception);
     else
         HandleException(null);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Handles the UnhandledException event of the CurrentDomain control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.UnhandledExceptionEventArgs"/> instance containing the event data.</param>
 private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (!e.IsTerminating)
     {
         Logger.Current.Error("Unhandled exception", e.ExceptionObject as Exception);
     }
 }
Ejemplo n.º 13
0
        void OnUnhandledException(object o, UnhandledExceptionEventArgs e) {
            // Let this occur one time for each AppDomain.
            if (Interlocked.Exchange(ref _unhandledExceptionCount, 1) != 0)
                return;

            StringBuilder message = new StringBuilder("\r\n\r\nUnhandledException logged by UnhandledExceptionModule.dll:\r\n\r\nappId=");

            string appId = (string) AppDomain.CurrentDomain.GetData(".appId");
            if (appId != null) {
                message.Append(appId);
            }
            

            Exception currentException = null;
            for (currentException = (Exception)e.ExceptionObject; currentException != null; currentException = currentException.InnerException) {
                message.AppendFormat("\r\n\r\ntype={0}\r\n\r\nmessage={1}\r\n\r\nstack=\r\n{2}\r\n\r\n",
                                     currentException.GetType().FullName, 
                                     currentException.Message,
                                     currentException.StackTrace);
            }           

            EventLog Log = new EventLog();
            Log.Source = _sourceName;
            Log.WriteEntry(message.ToString(), EventLogEntryType.Error);
        }
Ejemplo n.º 14
0
 private static void Application_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (e.ExceptionObject != null) {
         Exception ex = (Exception)e.ExceptionObject;
         MessageBox.Show(ex.Message, "Application exception");
     }
 }
        private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Tracer.Fatal(e.ExceptionObject);

            try
            {
                string timeStamp = GetTimeStamp();
                string fileName = String.Format("Crash {0}.log", timeStamp);

                string root = GetRoot();
                string filePath = Combine(root, fileName);

                using (StreamWriter writer = new StreamWriter(filePath))
                {
                    Version version = Assembly.GetEntryAssembly().GetName().Version;

                    writer.WriteLine("Crash Report");
                    writer.WriteLine("===================");
                    writer.WriteLine();
                    writer.WriteLine("Version {0}.{1}, Build {2}.{3}", version.Major, version.Minor, version.Build, version.Revision);
                    writer.WriteLine("Operating System: {0}", Environment.OSVersion);
                    writer.WriteLine(".NET Framework: {0}", Environment.Version);
                    writer.WriteLine("Time: {0}", DateTime.Now);
                    writer.WriteLine();
                    writer.WriteLine("Trace Message:");
                    writer.WriteLine(e.ExceptionObject);
                    writer.WriteLine();
                }
            }
            catch { } //Swallow it.
        }
Ejemplo n.º 16
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     FormError error = new FormError();
     error.Exception = e.ExceptionObject as Exception;
     error.Text = "Unexpected exception";
     error.ShowDialog();
 }
Ejemplo n.º 17
0
		private static void HandleAppDomainUnhandleException(object sender, UnhandledExceptionEventArgs args)
		{
			Exception e = (Exception)args.ExceptionObject;
			Logger.Instance.Log(e);
			System.Windows.MessageBox.Show("An unexpected error occured. Please send the 'errors.log' file accessible from settings." + Environment.NewLine
				+ "Message Error : " + Environment.NewLine + e.Message, "Error");
		}
Ejemplo n.º 18
0
 private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Logger.Log("PROGRAM", "Experienced fatal crash!");
     Logger.Log((Exception)e.ExceptionObject);
     MessageBox.Show("Ran into unexpected exception. Please report this!", "Unexpected exception in StreamsitePlayer", MessageBoxButtons.OK, MessageBoxIcon.Error);
     Application.Exit();
 }
Ejemplo n.º 19
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);
        }
Ejemplo n.º 20
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     var ex = (Exception)e.ExceptionObject;
     var message = ex.Message + Environment.NewLine + ex.Source + Environment.NewLine + ex.StackTrace
                   + Environment.NewLine + ex.InnerException;
     new Error().Add(message);
 }
Ejemplo n.º 21
0
 static void globalException(object sender, UnhandledExceptionEventArgs args)
 {
     Exception e = (Exception)args.ExceptionObject;
     Console.WriteLine("UnhandledException:\n\n" + e);
     MessageBox.Show("UnhandledException:\n\n" + e, "Updater Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     Environment.Exit(0);
 }
Ejemplo n.º 22
0
        //集約エラーハンドラ
        private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("ERROR THROWN:");
            System.Diagnostics.Debug.WriteLine(e.ExceptionObject);
            StringBuilder body = new StringBuilder();
            body.AppendLine("********************************************************************************");
            body.AppendLine(" ERROR TRACE: " + DateTime.Now.ToString());
            body.AppendLine("********************************************************************************");
            body.AppendLine(e.ExceptionObject.ToString());
            body.AppendLine();
            body.AppendLine("MEMORY USAGE:");
            var cp = System.Diagnostics.Process.GetCurrentProcess();
            body.AppendLine("paged:" + cp.PagedMemorySize64 + " / peak-virtual:" + cp.PeakVirtualMemorySize64);
            body.AppendLine(Environment.OSVersion.VersionString + " (is64?" + (IntPtr.Size == 8).ToString() + ")");
            body.AppendLine(Define.GetFormattedVersion() + " @" + Define.ExeFilePath);

            #region Freezable Bug 対策

            var argexcp = e.ExceptionObject as ArgumentException;
            if (argexcp != null && argexcp.Message.Contains("Freezable") && argexcp.ParamName == "context")
            {
                try
                {
                    body.AppendLine("FREEZABLE***************************************************");
                    body.AppendLine("Source:" + argexcp.Source);
                    body.AppendLine("FREEZABLE END************************************************");
                }
                catch { }
            }

            #endregion

            if (Define.IsOperatingSystemSupported)
            {
                var tpath = Path.GetTempFileName();
                using (var sw = new StreamWriter(tpath))
                {
                    sw.WriteLine(body.ToString());
                }
                var apppath = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);
                System.Diagnostics.Process.Start(Path.Combine(apppath, Define.FeedbackAppName), tpath);
                Environment.Exit(1);
            }
            else
            {
                // WinXPでβ以上の場合は何も吐かずに落ちる
                if (Define.IsNightlyVersion)
                {
                    /*
                    var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "krile_trace_" + Path.GetRandomFileName() + ".txt");
                    using (var sw = new StreamWriter(path))
                    {
                        sw.WriteLine(body.ToString());
                    }
                    */
                    MessageBox.Show("エラーが発生し、Krileの動作を継続できなくなりました。",
                            "サポート対象外のOS", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Ejemplo n.º 23
0
 /// <summary>
 /// Handles unhandled exceptions within the application.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The event arguments.</param>
 public static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     try
     {
         Exception ex = e.ExceptionObject as Exception;
         DialogResult result = MessageBox.Show(Strings_General.BugReportRequest, "Doh!", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
         if (result == DialogResult.Yes)
         {
             ErrorLog log = new ErrorLog(ex);
             XmlSerializer serializer = new XmlSerializer(typeof(ErrorLog));
             using (TextWriter writer = new StringWriter())
             {
                 serializer.Serialize(writer, log);
                 PostErrorLog(writer.ToString());
             }
         }
     }
     catch (Exception)
     {
     }
     finally
     {
         Environment.Exit(1);
     }
 }
Ejemplo n.º 24
0
 /// <summary>
 /// The handler of the unhandled exception.
 /// </summary>
 /// <param name="sender">The sender of the Exception.</param>
 /// <param name="e">The Exception event arguments.</param>
 public void OnAppDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (showExceptions)
     {
         DialogResult result = DialogResult.Cancel;
         try
         {
             result = this.ShowThreadExceptionDialog(e.ExceptionObject as Exception);
         }
         catch
         {
             try
             {
                 MessageBox.Show("Fatal Error",
                     "Fatal Error",
                     MessageBoxButtons.AbortRetryIgnore,
                     MessageBoxIcon.Stop);
             }
             finally
             {
                 Application.Exit();
             }
         }
         if (result == DialogResult.Abort)
             Application.Exit();
     }
 }
Ejemplo n.º 25
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     Log.LogError("CurrentDomain_UnhandledException");
     Log.LogError(e.ExceptionObject.ToString());
     MessageBox.Show("A fatal error has occurred and the application must shut down", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     Application.Exit();
 }
Ejemplo n.º 26
0
 void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (m_Log != null)
     {
         m_Log.Error("The process crashed for an unhandled exception!", (Exception)e.ExceptionObject);
     }
 }
Ejemplo n.º 27
0
        public static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            try
            {
                Exception ex = (Exception)e.ExceptionObject;
                string errorMsg = "Alkalmazás hiba, kérem indítsa újra az alkalmazást vagy forduljon a Support-hoz " +
                    "a következő adatokkal:\n\n";

                // Since we can't prevent the app from terminating, log this to the event log.
                DEFS.ExLog(errorMsg + ex.Message + "\n\nStack Trace:\n" + ex.StackTrace);
                MessageBox.Show(errorMsg, "E-Cafe rendszer", MessageBoxButtons.AbortRetryIgnore,
                                MessageBoxIcon.Stop);
            }
            catch (Exception exc)
            {
                try
                {
                    MessageBox.Show("Fatal Non-UI Error",
                        "Fatal Non-UI Error. Could not write the error to the event log. Reason: "
                        + exc.Message, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                finally
                {
                    Application.Exit();
                }
            }
        }
Ejemplo n.º 28
0
		private void UncaughtThreadException(object sender, UnhandledExceptionEventArgs e)
		{
			if(_isUncaughtUiThreadException)
				return;
			var exception = e.ExceptionObject as Exception;
			_logger.Fatal(exception);
		}
Ejemplo n.º 29
0
        /// <summary>
        /// Callback that handles update checking.
        /// </summary>
        /* static void UpdateManager_CheckCompleted(object sender, UpdateCheckCompletedEventArgs e)
        {
            if (e.Success && e.Information != null)
            {
                if (e.Information.IsNewVersion)
                {
                    Update.ConfirmAndInstall();
                }
            }
            else
            {
                Console.Error.WriteLine("Failed to check updates. {0}", e.Error);
            }
        }*/
        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            string dump = string.Format("preseriapreview-dump-{0}{1}{2}{3}{4}.txt",
                DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day,
                DateTime.Now.Hour, DateTime.Now.Minute);
            string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), dump);

            using (var s = new FileStream(path, FileMode.Create))
            {
                using (var sw = new StreamWriter(s))
                {
                    sw.WriteLine("Preseria-Preview Dump file");
                    sw.WriteLine("This file has been created because Preseria-Preview crashed.");
                    sw.WriteLine("Please send it to [email protected] to help fix the bug that caused the crash.");
                    sw.WriteLine();
                    sw.WriteLine("Last exception:");
                    sw.WriteLine(e.ExceptionObject.ToString());
                    sw.WriteLine();
                    sw.WriteLine("Preseria-Preview v. {0}", Assembly.GetEntryAssembly().GetName().Version);
                    sw.WriteLine("OS: {0}", Environment.OSVersion.ToString());
                    sw.WriteLine(".NET: {0}", Environment.Version.ToString());
                    sw.WriteLine("Aero DWM: {0}", WindowsFormsAero.OsSupport.IsCompositionEnabled);
                    sw.WriteLine("Launch command: {0}", Environment.CommandLine);
                    sw.WriteLine("UTC time: {0} {1}", DateTime.UtcNow.ToShortDateString(), DateTime.UtcNow.ToShortTimeString());
                }
            }
        }
Ejemplo n.º 30
0
		private static void CurrentDomainOnUnhandledException(object sender,
			UnhandledExceptionEventArgs unhandledExceptionEventArgs)
		{
			var newExc = new Exception("CurrentDomainOnUnhandledException",
				unhandledExceptionEventArgs.ExceptionObject as Exception);
			LogUnhandledException(newExc);
		}  
Ejemplo n.º 31
0
    static private void _OnUnresolvedExceptionHandler(object sender, System.UnhandledExceptionEventArgs args)
    {
        if (args == null)
        {
            return;
        }

        if (args.ExceptionObject == null)
        {
            return;
        }

        try
        {
            System.Type type = args.ExceptionObject.GetType();
            if (type == typeof(System.Exception))
            {
                System.Exception e = (System.Exception)args.ExceptionObject;
#if (UNITY_IPHONE && !UNITY_EDITOR)
                string str1 = _EscapeString(e.ToString());
                string str2 = _EscapeString(e.Message);
                string str3 = _EscapeString(e.StackTrace);

                Crittercism_NewException(str1, str2, str3);
                Crittercism_LogUnhandledException();
                Crittercism_LogUnhandledExceptionWillCrash();
#else
                string message = e.ToString() + "\n" + e.Message + "\n" + e.StackTrace;
                if (args.IsTerminating)
                {
                    if (Debug.isDebugBuild == true || _ShowDebugOnOnRelease == true)
                    {
                        Debug.LogError("CrittercismIOS: Terminal Exception: " + message);
                    }
                }
                else
                {
                    if (Debug.isDebugBuild == true || _ShowDebugOnOnRelease == true)
                    {
                        Debug.LogWarning(message);
                    }
                }
#endif
            }
            else
            {
                if (Debug.isDebugBuild == true || _ShowDebugOnOnRelease == true)
                {
                    Debug.Log("CrittercismIOS: Unknown Exception Type: " + args.ExceptionObject.ToString());
                }
            }
        }catch {
            if (Debug.isDebugBuild == true || _ShowDebugOnOnRelease == true)
            {
                Debug.Log("CrittercismIOS: Failed to resolve exception");
            }
        }
    }
 private static void OnUnhandledException(object sender, System.UnhandledExceptionEventArgs args)
 {
     if (!isInitialized || args == null || args.ExceptionObject == null)
     {
         return;
     }
     System.Exception e = args.ExceptionObject as System.Exception;
     if (e != null)
     {
         LogUnhandledException(e);
     }
 }
Ejemplo n.º 33
0
    private static void _OnUnresolvedExceptionHandler(object sender, System.UnhandledExceptionEventArgs args)
    {
        if (!isInitialized || args == null || args.ExceptionObject == null)
        {
            return;
        }

        if (args.ExceptionObject.GetType() != typeof(System.Exception))
        {
            return;
        }


        doLogError((System.Exception)args.ExceptionObject);
    }
Ejemplo n.º 34
0
        public static void AppDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
        {
            try
            {
                Exception ex  = (Exception)e.ExceptionObject;
                string[]  log = new string[] { $"[{DateTime.Now.ToString()}] - AppDomain_UnhandledException - {ex.Message}", ex.StackTrace };


                if (File.Exists(LOG_FILE))
                {
                    File.AppendAllLines(LOG_FILE, log);
                }
                else
                {
                    File.WriteAllLines(LOG_FILE, log);
                }
            }
            catch (Exception eX)
            {
                MessageBox.Show(eX.Message);
            }
        }
Ejemplo n.º 35
0
        private static void OnUnhandledException(object sender, System.UnhandledExceptionEventArgs e)
        {
            Exception exception = e.ExceptionObject as Exception ?? new Exception("Unknown unhandled exception");

            if (exception.GetType().FullName == "System.Configuration.ConfigurationErrorsException")
            {
                MessageBox.Show("Your configuration file is corrupted and will be deleted automatically, please try to launch celeste studio again.",
                                "Configuration Errors Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
                string configFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Celeste_Studio");
                if (Directory.Exists(configFolder))
                {
                    Directory.Delete(configFolder, true);
                }
            }
            else
            {
                ErrorLog.Write(exception);
                ErrorLog.Open();
            }

            Application.Exit();
        }
Ejemplo n.º 36
0
 static private void _OnUnresolvedExceptionHandler(object sender, System.UnhandledExceptionEventArgs args)
 {
     if (args == null || args.ExceptionObject == null)
     {
         return;
     }
     try {
         System.Type type = args.ExceptionObject.GetType();
         if (type == typeof(System.Exception))
         {
             System.Exception e = (System.Exception)args.ExceptionObject;
             if (Application.platform == RuntimePlatform.IPhonePlayer)
             {
                 // Should never get here since the Init() call would have bailed on the same if statement
                 Crittercism_LogUnhandledException(e.GetType().FullName, e.Message, StackTrace(e), crUnityId);
             }
         }
     } catch {
         if (Debug.isDebugBuild == true)
         {
             Debug.Log("CrittercismIOS: Failed to log exception");
         }
     }
 }
Ejemplo n.º 37
0
    private static void _OnUncaughtExceptionHandler(object sender, System.UnhandledExceptionEventArgs args)
    {
        if (args == null || args.ExceptionObject == null)
        {
            return;
        }

        try
        {
            if (args.ExceptionObject.GetType() != typeof(System.Exception))
            {
                return;
            }
        }
        catch
        {
            if (UnityEngine.Debug.isDebugBuild == true)
            {
                UnityEngine.Debug.Log("BuglyAgent: Failed to report uncaught exception");
            }

            return;
        }

        if (!IsInitialized)
        {
            return;
        }

        if (_uncaughtAutoReportOnce)
        {
            return;
        }

        _HandleException((System.Exception)args.ExceptionObject, null, true);
    }
 public void Show(System.UnhandledExceptionEventArgs args)
 {
     Show(args.ExceptionObject as Exception);
 }
Ejemplo n.º 39
0
        private void OnUnhandledException(object sender, System.UnhandledExceptionEventArgs e)
        {
            var str = GetStringAsBase64(e.ExceptionObject.ToString());

            _channel.Send("AppDomainException", str);
        }
Ejemplo n.º 40
0
 private static void ReportUnobservedException(object sender, System.UnhandledExceptionEventArgs eventArgs)
 {
     Exception exception = (Exception)eventArgs.ExceptionObject;
     // WriteLog("Unobserved exception: {0}", exception);
 }
Ejemplo n.º 41
0
 void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     Trace.WriteLine("App domain unhandled exception: " + e.ExceptionObject.ToString());
 }
Ejemplo n.º 42
0
 static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     Program.SaveException((Exception)e.ExceptionObject);
 }
Ejemplo n.º 43
0
 private static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine(e.ExceptionObject.ToString());
     Console.WriteLine(e.ExceptionObject.ToString());
 }
Ejemplo n.º 44
0
 /// <summary>
 /// Global Exception Handler.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     Telemetry.TrackException(nameof(CurrentDomain_UnhandledException), e.ExceptionObject as Exception);
 }
Ejemplo n.º 45
0
 private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     LogException((Exception)e.ExceptionObject);
 }
Ejemplo n.º 46
0
 void TaskManager_UnobservedTaskException(FluentScheduler.Model.TaskExceptionInformation sender, System.UnhandledExceptionEventArgs e)
 {
     EventLog.WriteEntry("FluentScheduler",
                         string.Format("Ocorreu uma excessão não tratada. \n  Tarefa {0}\n    Exception: {1}",
                                       sender.Name, (e.ExceptionObject as Exception).ToString()), EventLogEntryType.Error);
 }
Ejemplo n.º 47
0
 public static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     LogisTrac.WriteLog(e.ExceptionObject.ToString());
     // Functions.ShowMessageBox("系统异常,请联系管理员! ", Const.EVENT_INFO);
 }
Ejemplo n.º 48
0
 /// <summary>
 /// Called when an unhandled exception appears.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">
 /// The <see cref="System.UnhandledExceptionEventArgs" /> instance containing the event data.
 /// </param>
 private static void OnCurrentDomainUnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     // we come here if there is any exception not handled correctly (i.e. in CustomContext).
     // normally we should log, display error to user and exit the app.
     System.Environment.Exit(0);
 }
Ejemplo n.º 49
0
 private void HandleUnCaughtException(object sender, System.UnhandledExceptionEventArgs args)
 {
     //args.Handled = true;
 }
Ejemplo n.º 50
0
 private void Domain_UnhandledException(object source, System.UnhandledExceptionEventArgs e)
 {
     Log.Fatal(PluginName + " plugin has fatally crashed. ERROR: \n" + e.ExceptionObject.ToString());
     AppDomain.Unload(_domain);
 }
Ejemplo n.º 51
0
 private void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     logger.Debug(sender.GetType().Name + "|" + (e.ExceptionObject as Exception).Message);
 }
Ejemplo n.º 52
0
        private void OnCurrentDomainUnhandledException(object sender, System.UnhandledExceptionEventArgs e)
        {
            var target = e.ExceptionObject is Exception ex ? ex : e.ExceptionObject;

            Console.WriteLine($"UnhandledException:{target}");
        }
Ejemplo n.º 53
0
 private void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     // 后台线程异常,执行到这里的应用就会闪退
 }
Ejemplo n.º 54
0
 private static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     OnUnhandledException(sender, e.ExceptionObject);
 }
Ejemplo n.º 55
0
 /// <summary>
 /// Globalis hiba elkaopó
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void CurrentDomainOnUnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     new ErrorHandlerService().Show(e);
 }
Ejemplo n.º 56
0
 private static void AppDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     lock (SyncRoot) {
         Process(e.ExceptionObject as System.Exception);
     }
 }
Ejemplo n.º 57
0
        void OnCurrentDomainUnhandledException(object sender, System.UnhandledExceptionEventArgs e)
        {
            var unhandledExceptionArgs = new UnhandledExceptionEventArgs(e.ExceptionObject, e.IsTerminating);

            Callback.OnUnhandledException(Widget, unhandledExceptionArgs);
        }
Ejemplo n.º 58
0
 public static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
 {
     CrashReporter.Instance.Write(e.ExceptionObject as Exception);
 }
Ejemplo n.º 59
0
 private static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
 {
     // Doesn't matter what you do, the application will terminate.
 }
Ejemplo n.º 60
-1
        // Handle the UI exceptions by showing a dialog box, and asking the user whether
        // or not they wish to abort execution.
        // NOTE: This exception cannot be kept from terminating the application - it can only
        // log the event, and inform the user about it.
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            try
            {
                var ex = (Exception)e.ExceptionObject;
                const string errorMsg = "An error occurred in Subtitle Edit. Please contact the adminstrator with the following information:\n\n";

                // Since we can't prevent the app from terminating, log this to the event log.
                if (!EventLog.SourceExists("ThreadException"))
                {
                    EventLog.CreateEventSource("ThreadException", "Application");
                }

                // Create an EventLog instance and assign its source.
                using (var eventLog = new EventLog { Source = "ThreadException" })
                {
                    eventLog.WriteEntry(errorMsg + ex.Message + "\n\nStack Trace:\n" + ex.StackTrace);
                }
            }
            catch (Exception exc)
            {
                try
                {
                    MessageBox.Show("Fatal Non-UI Error in Subtitle Edit", "Fatal Non-UI Error. Could not write the error to the event log. Reason: " + exc.Message, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                finally
                {
                    Application.Exit();
                }
            }
        }