static void TryShowDialog(string moreInfo, string message, string title, Exception e)
 {
     try {
         ShowDialog(moreInfo, message, title, e);
     } catch (Exception exception) {
         var errorInfo = "\n\nError using proper error dialog:" + PrettyExceptions.FormatException(exception);
         MessageBox.Show(moreInfo == null ? message + errorInfo : message + "\n\n" + moreInfo + errorInfo, title,
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #2
0
 static void LogError(Exception ex)
 {
     try {
         LogManager.GetCurrentClassLogger().Error(PrettyExceptions.FormatException(ex), ex);
     } catch (Exception e) {
         try {
             LogManager.GetCurrentClassLogger().Error("Error during error handling", e);
             LogManager.GetCurrentClassLogger().Error("Error", ex);
         } catch {}
     }
 }
        public bool Handle(Exception exception, ReportExceptionEventArgs e = null)
        {
            var r = InternalHandler(exception, e);

            if (string.IsNullOrEmpty(r.Item1))
            {
                return(r.Item2);
            }

            var moreInfo = PrettyExceptions.FormatException(exception);

            if (e != null)
            {
                e.AddCustomProperty("Six.Handled", r.Item1);
                e.TryToContinue = false;
            }

            ExitMessageHandler(exception, r, moreInfo);

            return(r.Item2);
        }
Exemple #4
0
 static void TryAddFullExceptionTrace(ReportExceptionEventArgs e)
 {
     try {
         e.AddCustomProperty("Full exception trace", PrettyExceptions.FormatException(e.Exception));
     } catch {}
 }