I’ve started new Gtk# solution with MonoDevelop. Now where I can put global exception handler that popups a dialog to user with stack traces etc? Is there any existing libraries that can do this?
Something like https://exceptionreporter.codeplex.com/
Main.cs:
using System;
using Gtk;
namespace foobar
{
class MainClass
{
public static void Main (string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
win.Show ();
Application.Run ();
}
}
}
MainWindow.cs:
using System;
using Gtk;
public partial class MainWindow: Gtk.Window
{
public MainWindow (): base (Gtk.WindowType.Toplevel)
{
Build ();
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
}
}
You can use the
GLib.ExceptionManager.UnhandledExceptionevent.Its argument of type
GLib.UnhandledExceptionArgs Classcontains anExitApplicationproperty that can be used to control whether the application should exit due to the exception.