Exemple #1
0
 static void OnException(UnhandledExceptionArgs args)
 {
     //MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, args.ExceptionObject.ToString());
     MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "Hiba történt!");
     md.Run();
     md.Destroy();
 }
 private static void OnUnhandledException(UnhandledExceptionArgs args) {
     Log.Fatal("Unhandled Exception.", (Exception) args.ExceptionObject);
     Console.WriteLine("Fatal Error: {0} ... {1}", args.ExceptionObject, args.IsTerminating);
     MessageBox.Show(new FatalErrorWindow(), "Unhandled exception.\n" +
                                             "Please raise an issue on the Support website.",
         ButtonsType.Ok, MessageType.Error);
     args.ExitApplication = true;
 }
Exemple #3
0
 private static void HandleUnhandledException(UnhandledExceptionArgs e)
 {
     Exception ex = e.ExceptionObject as Exception;
     string message = ex == null ? e.ExceptionObject.ToString() : ex.ToString();
     string title = "Unhandled exception";
     DialogFlags flags = DialogFlags.Modal | DialogFlags.DestroyWithParent;
     Dialog dialog = new Dialog(title, MainWindow, flags);
     Label label = new Label(message);
     VBox vBox = (VBox)dialog.Child;
     vBox.Add(label);
     dialog.ShowAll();
     e.ExitApplication = false;
 }
Exemple #4
0
        void HandleExceptionManagerUnhandledException(UnhandledExceptionArgs args)
        {
            Exception ex = (Exception)args.ExceptionObject;

            Console.WriteLine("Unhandled Exception: {0}", ex.GetType ().ToString ());
            Console.WriteLine("\t{0}", ex.Message);
            Console.WriteLine("\t{0}", ex.Source);
            Console.WriteLine("\t{0}", ex.StackTrace);

            MessageDialog d = new MessageDialog (null, DialogFlags.Modal, MessageType.Error,
                                                 ButtonsType.Close, true, "<b>{0}</b>: {1} at <i>{2}</i>",
                                                 ex.GetType ().ToString(),
                                                 ex.Message, ex.Source);
            d.Run ();
            d.Hide ();
            d.Dispose ();
            args.ExitApplication = true;
        }
		public static void RaiseUnhandledException (Exception e, bool is_terminal)
		{
			if (UnhandledException == null) {
				Console.Error.WriteLine ("Exception in Gtk# callback delegate");
				Console.Error.WriteLine ("  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.");
				Console.Error.WriteLine (e);
				Console.Error.WriteLine (new System.Diagnostics.StackTrace (true));
				Environment.Exit (1);
			}

			UnhandledExceptionArgs args = new UnhandledExceptionArgs (e, is_terminal);
			try {
				UnhandledException (args);
			} catch (Exception ex) {
				Console.Error.WriteLine (ex);
				Environment.Exit (1);
			}

			if (is_terminal || args.ExitApplication)
				Environment.Exit (1);
		}
Exemple #6
0
 protected void OnExceptionEvent(UnhandledExceptionArgs u)
 {
     Exception e = u.ExceptionObject as Exception;
     Logger.ErrorFormat(this, "Unhandled Exception: {0}", e.Message);
 }
Exemple #7
0
	/* Event members */

	private static void OnUnhandledException (UnhandledExceptionArgs args) {
		if (args.ExceptionObject is Exception)
			BugReporter.Report(args.ExceptionObject as Exception);

		Kill();
	}
Exemple #8
0
 void OnUnhandledException(UnhandledExceptionArgs args)
 {
     Console.WriteLine(args.ExceptionObject);
 }
Exemple #9
0
 private static void ExceptionManager_UnhandledException(UnhandledExceptionArgs args)
 {
     LogManager.GetLogger(typeof (Program)).Fatal(string.Format("Unhandled error {0}", args.ExceptionObject), args.ExceptionObject as Exception);
 }