private async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { _telemetryClientProvider.Client.TrackException(e.Exception); _telemetryClientProvider.Client.Flush(); await new MessageDialog(e.Exception.Message).ShowAsync(); }
private static void ExceptionHandler(object sender, UnhandledExceptionEventArgs args) { Exception e = (Exception) args.ExceptionObject; Console.WriteLine("ExceptionHandler caught {0} with message {1}.\nExiting: ", e, e.Message); Environment.Exit(1); }
static void OnApplicationUnhandledException(object sender, UnhandledExceptionEventArgs e) { var exception = e.ExceptionObject as Exception; Debug.Assert(exception != null, "exception != null"); // Write the exception's details to a log file using (var stream = new StreamWriter(Path.Combine(Utilities.ApplicationBaseDirectory, "CrashLogs.txt"), true)) { stream.WriteLine( Utilities.NewLineString + exception.Message + Utilities.NewLineString + exception.StackTrace ); } // Make sure that Monero core applications get closed before exit if (Utilities.MoneroRpcManager != null) { Utilities.MoneroRpcManager.Dispose(); } if (Utilities.MoneroProcessManager != null) { Utilities.MoneroProcessManager.Dispose(); } // Exit with an error code Environment.Exit(1); }
public static void MyHandler(object sender, UnhandledExceptionEventArgs args) { Console.WriteLine("UnhandledExceptionEventHandler called"); }
private async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; var unhandledException = e.Exception; var dialog = new MessageDialog($@"Homebased crashed :( {Environment.NewLine}Please close the application and try again. {Environment.NewLine}But before you do, do you want to mail us the crash report, to see if there's anything we can do?", "Homebased crashed #!$*"); dialog.Commands.Add(new UICommand("Yes", new UICommandInvokedHandler(async cmd => { var sendTo = new EmailRecipient() { Name = "Homebased", Address = "*****@*****.**" }; var mail = new EmailMessage(); mail.Subject = $"Homebased crashed :("; mail.Body = unhandledException.ToString(); mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }))); dialog.Commands.Add(new UICommand("No", new UICommandInvokedHandler(cmd => { }))); await dialog.ShowAsync(); }
private async void SynchronizationContext_UnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; await new MessageDialog("Synchronization Context Unhandled Exception:\r\n" + e.Exception.Message) .ShowAsync(); }
private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { var errorMessage = e.Exception.ToString(); Debug.WriteLine(errorMessage); var message = new MessageDialog(errorMessage, "An error occurred").ShowAsync(); e.Handled = true; }
// Invoked when unhandled event occurs static void unhandledException(object sender, UnhandledExceptionEventArgs args) { //TODO create some sort of notification service for unhandled exceptions Exception e = (Exception)args.Exception; Debug.WriteLine("MyHandler caught : " + e.Message); }
public Task<IEnumerable<Song>> GetSongs(string query, CancellationToken cancellationToken) { return Task.Factory.StartNew(() => { var lockObject = new object(); var songs = new List<Song>(200); Parallel.ForEach(Providers, p => { try { var result = p.GetSongs(query, cancellationToken).Result; lock (lockObject) { songs.AddRange(result); } } catch(Exception e) { var args = new UnhandledExceptionEventArgs(e); OnUnhandledException(args); if (!args.Handled) { throw; } } }); return (IEnumerable<Song>)songs.ToArray(); }); }
private async void AppUnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; await new MessageDialog("应用程序出错:\r\n" + e.Exception.Message) .ShowAsync(); }
static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e) { lock (monitor) { Monitor.Pulse (monitor); } Environment.Exit (0); }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Exception theException = (Exception)e.ExceptionObject; Console.WriteLine(theException.ToString()); // Exit to avoid unhandled exception dialog Environment.Exit(-1); }
private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (System.Diagnostics.Debugger.IsAttached) { // An unhandled exception has occurred; break into the debugger System.Diagnostics.Debugger.Break(); } }
private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (Debugger.IsAttached) { Debug.WriteLine(e.Message); Debug.WriteLine(e.Exception.StackTrace); } }
private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { #if DEBUG if (Debugger.IsAttached) { Debugger.Break(); } #endif }
private static void OnException(object sender, UnhandledExceptionEventArgs eventArgs) { var exception = eventArgs.Exception; exception.Data.Add("Message", eventArgs.Message); // set as handled to allow reporting error and on complete shut down app ReportingService.Instance.BeginReport(exception, OnReportCompleted); eventArgs.Handled = true; }
private async void Current_UnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; logger.Info("Catched unobserved exception from Dispatcher! Type={0}, Message={1}", new object[] { e.Exception.GetType().Name, e.Exception.Message }); await HandleUnhandledException(e); Application.Current.Exit(); }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (e.IsTerminating) { LogTo.Error(e.ExceptionObject as Exception, "Could not show error dialog. Shutting down."); return; } HandleException(e.ExceptionObject as Exception, "CurrentDomain_UnhandledException"); }
private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; var err = e.Message; var dialog = new MessageDialog(err); dialog.Title = "Exception?"; dialog.Commands.Add(new UICommand { Label = "Ok", Id = 0 }); var res = dialog.ShowAsync(); }
void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Crystal.Services.ServiceManager.Resolve<Crystal.Services.IMessageBoxService>() .ShowMessage( LocalizationManager.GetLocalizedValue("UnusualErrorHeader"), LocalizationManager.GetLocalizedValue("UnusualErrorMsg") + Environment.NewLine + e.Message + Environment.NewLine + e.Exception.StackTrace); e.Handled = true; }
void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { LogHelper.Error(e.Exception); //LOG Exception e.Handled = true; System.Diagnostics.Debug.WriteLine(string.Format("{1} @ {0} @ {2} ", e.Exception, e.Message, e.Exception != null ? e.Exception.StackTrace : string.Empty)); //throw new NotImplementedException(); }
private void OnUnhandledException(object sender, UnhandledExceptionEventArgs args) { StackTrace stackTrace = new StackTrace(args.Exception, true); string stackTraceString = args.Exception.StackTrace == null ? stackTrace.ToString() : args.Exception.StackTrace; string errText = string.Format("An unhandled exception occurred: {0}\r\nStack Trace: {1}", args.Message, stackTraceString); Debug.WriteLine(errText); args.Handled = true; }
void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; if(rootFrame != null) { ErrorPage.Exception = e.Exception; rootFrame.Navigate(typeof(ErrorPage)); e.Handled = true; } }
static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e) { string str = e.ExceptionObject.ToString (); if (str.IndexOf ("From the threadpool") != -1) return_value = 3; lock (monitor) { Monitor.Pulse (monitor); } Environment.Exit (return_value); }
private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { // this can happen when backkeypress is clicked quickly after navigating to the contract list. // can't figure out why if (e is UnhandledExceptionEventArgs && e.Message.Contains("The parameter is incorrect.")) { e.Handled = true; return; } }
async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (e.Exception is System.Runtime.InteropServices.COMException) { // e.Handled = true; } else { await ExceptionHandler.instance.PostException(new AppException(e.Exception, (int)ClientIDHandler.AppName._30Seconds)); } }
void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; StringBuilder sb = new StringBuilder(); sb.AppendFormat("Message: {0}\n", e.Message); sb.AppendFormat("StackTrace: {0}\n", e.Exception.StackTrace); this.unhandledExceptionMessage = sb.ToString(); Notification.UserChoice("Something went wrong! Please, help us improve this application, by sending error report", "Send Report", "Cancel", new UICommandInvokedHandler(this.CommandInvokedHandler)); }
private async void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; var file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync("ErrorLog.txt", Windows.Storage.CreationCollisionOption.GenerateUniqueName); using (var fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite)) { using (var writer = new StreamWriter(fileStream.AsStreamForWrite())) { await writer.WriteLineAsync(e.Exception.ToString()); } } App.Current.Exit(); }
/// <summary> /// Error handler. /// </summary> private void OnError(object sender, UnhandledExceptionEventArgs error) { // Flag handled so app can continue error.Handled = true; // Create error dialog var dialog = new MessageDialog("Error", error.Message); // Show dialog // TODO: Get this working var uiScheduler = TaskScheduler.FromCurrentSynchronizationContext(); var uiFactory = new TaskFactory(uiScheduler); uiFactory.StartNew(() => { dialog.ShowAsync().AsTask().Wait(); }).Wait(); }
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (ChatterBox.Client.Common.Settings.SignalingSettings.AppInsightsEnabled) { ExceptionTelemetry excTelemetry = new ExceptionTelemetry((Exception)e.Exception); excTelemetry.SeverityLevel = SeverityLevel.Critical; excTelemetry.HandledAt = ExceptionHandledAt.Unhandled; excTelemetry.Timestamp = System.DateTimeOffset.UtcNow; var telemetry = new TelemetryClient(); telemetry.TrackException(excTelemetry); telemetry.Flush(); } }
static void MyHandler(object sender, UnhandledExceptionEventArgs args) { File.Create("success.txt"); }
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { string message = OsLocalization.MainWindow.Message5 + e.ExceptionObject; MessageBox.Show(message); }
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Logger.Fatal("Application Error", (Exception)e.ExceptionObject); MsgDialog.Show("Sorry, some errors occurred, the error message is saved in log"); Application.Current.Shutdown(); }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Console.WriteLine(e.ToString()); Log.Write(e.ToString()); }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { log.Error(e.ExceptionObject); }
private void OnUnhandledException(object sender, UnhandledExceptionEventArgs args) { Telemetry.TrackException(args.ExceptionObject as Exception); Telemetry.Flush(); }
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { File.WriteAllText("SA2EventViewer.log", e.ExceptionObject.ToString()); MessageBox.Show("Unhandled Exception: " + e.ExceptionObject.GetType().Name + "\nLog file has been saved.", "SA2 Event Viewer Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
private static void UnhandledExceptionTrapper(object sender, UnhandledExceptionEventArgs e) { Console.WriteLine(e.ExceptionObject.ToString()); logger.Error(e.ExceptionObject.ToString()); Environment.Exit(1); }
/// <summary> /// Write log /// </summary> /// <param name="e">UnhandledExceptionEventArgs</param> public static void WriteLog(UnhandledExceptionEventArgs e) { Exception ex = (Exception)e.ExceptionObject; WriteLog(ex); }
private static void TopLevelErrorHandler(object sender, UnhandledExceptionEventArgs args) { Exception e = (Exception)args.ExceptionObject; Console.WriteLine("Error Occured : " + e.Message); }
private static void UnhandledExceptionEventHandler(object obj, UnhandledExceptionEventArgs args) { Logger.Write("Exception caught, writing LogBuffer.", force: true); throw new Exception(); }
async void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { var logger = LoggerFactory.GetAsynchronous <App>(); await logger?.FatalAsync(e.Message, e.Exception); }
private void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e) { //throw new NotImplementedException(); //系统奔溃的问题收集 }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { TradeLink.AppKit.CrashReport.Report(QuotopiaMain.PROGRAM, (Exception)e.ExceptionObject); }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { OnFatalException(e.ExceptionObject as Exception); }
private void SynchronizationContext_UnhandledException(object sender, UnhandledExceptionEventArgs e) { UnhandledException?.Invoke(this, e); }
public static void UnhandledExceptionTrapper(object sender, UnhandledExceptionEventArgs e) { Console.WriteLine("Unhandled exception: ", e); }
private static void UnexpectedExceptionHandler(object sender, UnhandledExceptionEventArgs args) { Environment.Exit(3); }
private void UnhandledException(object sender, UnhandledExceptionEventArgs args) { var ex = (Exception)args.ExceptionObject; Logger.Log("UnhandledException", ex); }
//非處理UI執行緒錯誤 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Exception err = e.ExceptionObject as Exception; comQryLCU.Agent_WriteLog(err.Message); }
private static void ReportUnobservedException(object sender, UnhandledExceptionEventArgs eventArgs) { Exception exception = (Exception)eventArgs.ExceptionObject; WriteLog("Unobserved exception: {0}", exception); }
private static void UncaughtExceptionHandler(object sender, UnhandledExceptionEventArgs args) { Console.Error.WriteLine("FATAL: UncaughtExceptionHandler: {0}", args.ExceptionObject); Environment.Exit(1); }
private void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e) { Logger.Error($"Unhandled exception: {e}"); }
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { ExitSystemError(e.ExceptionObject as Exception); }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Exception exception = (Exception)e.ExceptionObject; Exit(exception); }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { #if !DEBUG _raygunClient.Send(e.ExceptionObject as Exception); #endif }
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { }
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) { SendReport((Exception)unhandledExceptionEventArgs.ExceptionObject); Environment.Exit(0); }
static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e) { HandleUnhandledException((Exception)e.ExceptionObject); }
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Exception ex = e.ExceptionObject as Exception; MessageBox.Show(ex.Message, "Uncaught Thread Exception", MessageBoxButton.OK, MessageBoxImage.Error); }