Example #1
0
        public void ReportUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs args)
        {
            Exception exception = args.Exception;

            Log.ErrorFormat("Caught unexpected exception on dispatcher: {0}", exception);

            var notification = new UnhandledException(exception);
            Add(notification);

            args.Handled = true;
        }
Example #2
0
        public void ReportUnhandledException(object sender, UnobservedTaskExceptionEventArgs args)
        {
            Exception exception = args.Exception;

            Log.ErrorFormat("Caught unexpected exception on task: {0}", exception);

            var notification = new UnhandledException(exception);
            Add(notification);

            args.SetObserved();
        }