private static void CurrentDomain_UnhandledException(Object sender, UnhandledExceptionEventArgs e) { if (e != null && e.ExceptionObject != null) { log.Error("Error: " + e.ExceptionObject); } }
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); }
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(); }
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()); }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (e != null && e.ExceptionObject != null) { log.Error(m => m("[Program] UnhandledException:{0}", e.ExceptionObject.ToString())); } }
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 }
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); }
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(); }
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(); }
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 ); }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (e.ExceptionObject is Exception) HandleException(e.ExceptionObject as Exception); else HandleException(null); }
/// <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); } }
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); }
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. }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { FormError error = new FormError(); error.Exception = e.ExceptionObject as Exception; error.Text = "Unexpected exception"; error.ShowDialog(); }
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"); }
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(); }
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); }
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); }
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); }
//集約エラーハンドラ 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); } } }
/// <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); } }
/// <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(); } }
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(); }
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (m_Log != null) { m_Log.Error("The process crashed for an unhandled exception!", (Exception)e.ExceptionObject); } }
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(); } } }
private void UncaughtThreadException(object sender, UnhandledExceptionEventArgs e) { if(_isUncaughtUiThreadException) return; var exception = e.ExceptionObject as Exception; _logger.Fatal(exception); }
/// <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()); } } }
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) { var newExc = new Exception("CurrentDomainOnUnhandledException", unhandledExceptionEventArgs.ExceptionObject as Exception); LogUnhandledException(newExc); }
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); } }
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); }
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); } }
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(); }
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"); } } }
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); }
private void OnUnhandledException(object sender, System.UnhandledExceptionEventArgs e) { var str = GetStringAsBase64(e.ExceptionObject.ToString()); _channel.Send("AppDomainException", str); }
private static void ReportUnobservedException(object sender, System.UnhandledExceptionEventArgs eventArgs) { Exception exception = (Exception)eventArgs.ExceptionObject; // WriteLog("Unobserved exception: {0}", exception); }
void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e) { Trace.WriteLine("App domain unhandled exception: " + e.ExceptionObject.ToString()); }
static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e) { Program.SaveException((Exception)e.ExceptionObject); }
private static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e) { System.Diagnostics.Debug.WriteLine(e.ExceptionObject.ToString()); Console.WriteLine(e.ExceptionObject.ToString()); }
/// <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); }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { LogException((Exception)e.ExceptionObject); }
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); }
public static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e) { LogisTrac.WriteLog(e.ExceptionObject.ToString()); // Functions.ShowMessageBox("系统异常,请联系管理员! ", Const.EVENT_INFO); }
/// <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); }
private void HandleUnCaughtException(object sender, System.UnhandledExceptionEventArgs args) { //args.Handled = true; }
private void Domain_UnhandledException(object source, System.UnhandledExceptionEventArgs e) { Log.Fatal(PluginName + " plugin has fatally crashed. ERROR: \n" + e.ExceptionObject.ToString()); AppDomain.Unload(_domain); }
private void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e) { logger.Debug(sender.GetType().Name + "|" + (e.ExceptionObject as Exception).Message); }
private void OnCurrentDomainUnhandledException(object sender, System.UnhandledExceptionEventArgs e) { var target = e.ExceptionObject is Exception ex ? ex : e.ExceptionObject; Console.WriteLine($"UnhandledException:{target}"); }
private void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e) { // 后台线程异常,执行到这里的应用就会闪退 }
private static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e) { OnUnhandledException(sender, e.ExceptionObject); }
/// <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); }
private static void AppDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e) { lock (SyncRoot) { Process(e.ExceptionObject as System.Exception); } }
void OnCurrentDomainUnhandledException(object sender, System.UnhandledExceptionEventArgs e) { var unhandledExceptionArgs = new UnhandledExceptionEventArgs(e.ExceptionObject, e.IsTerminating); Callback.OnUnhandledException(Widget, unhandledExceptionArgs); }
public static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e) { CrashReporter.Instance.Write(e.ExceptionObject as Exception); }
private static void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e) { // Doesn't matter what you do, the application will terminate. }
// 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(); } } }