Beispiel #1
0
        private string GetExceptionInfo(Exception ex)
        {
            StringBuilder sb     = new StringBuilder();
            StringWriter  writer = new StringWriter(sb);

            AppTextExceptionFormatter formatter = new AppTextExceptionFormatter(writer, ex);

            // Format the exception
            formatter.Format();

            return(sb.ToString());
        }
        // Creates the error message and displays it.
        private DialogResult ShowThreadExceptionDialog(Exception ex)
        {
            string errorMsg = "The following exception was caught by the Quick Start Global Exception Handler:" + Environment.NewLine + Environment.NewLine;

            StringBuilder sb = new StringBuilder();
            StringWriter writer = new StringWriter(sb);

            AppTextExceptionFormatter formatter = new AppTextExceptionFormatter(writer, ex);

            // Format the exception
            formatter.Format();

            errorMsg +=  sb.ToString();

            return MessageBox.Show(errorMsg, "Application Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        }
Beispiel #3
0
        // Creates the error message and displays it.
        private DialogResult ShowThreadExceptionDialog(Exception ex)
        {
            string errorMsg = "The following exception was caught by the Quick Start Global Exception Handler:" + Environment.NewLine + Environment.NewLine;

            StringBuilder sb     = new StringBuilder();
            StringWriter  writer = new StringWriter(sb);

            AppTextExceptionFormatter formatter = new AppTextExceptionFormatter(writer, ex);

            // Format the exception
            formatter.Format();

            errorMsg += sb.ToString();

            return(MessageBox.Show(errorMsg, "Application Error", MessageBoxButtons.OK, MessageBoxIcon.Stop));
        }
        private string GetExceptionInfo(Exception ex)
        {
            StringBuilder sb = new StringBuilder();
            StringWriter writer = new StringWriter(sb);

            AppTextExceptionFormatter formatter = new AppTextExceptionFormatter(writer, ex);

            // Format the exception
            formatter.Format();

            return sb.ToString();
        }