Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Last active June 22, 2017 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/5b51af8cdb22fc00b41a5e7b6064b964 to your computer and use it in GitHub Desktop.
Save dcomartin/5b51af8cdb22fc00b41a5e7b6064b964 to your computer and use it in GitHub Desktop.
// In MainActivity
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
//TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException; ????
Xamarin.Forms.Forms.Init(this, bundle);
var app = new App();
LoadApplication(app);
}
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs)
{
try
{
// (unhandledExceptionEventArgs.ExceptionObject as Exception).ToExceptionless.Submit();// or whatever it is
}
catch
{
// just suppress any error logging exceptions
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment