Beispiel #1
0
        public static void HandleUncaughtException(Exception e, bool fatal)
        {
            // Create an error report.
            BugReport report = new BugReport
            {
                FogBugzUrl     = "https://philltest.fogbugz.com/ScoutSubmit.asp",
                UserName       = "******",
                Project        = "BugzScoutSharp",
                Area           = "Reports",
                DefaultMessage = DEFAULT_BUGZSCOUT_MESSAGE,
            };

            if (fatal)
            {
                report.Description += "\n*** FATAL ERROR ***\n";
            }

            report.AddMachineDetails("\nDiscovered by");
            report.AddExceptionDetails(e);
            report.Description += "Application version: " + Util.GetProgramVersion( ) + " (built on " + Util.GetProgramBuildDate( ).ToShortDateString( ) + ")" + Environment.NewLine;
            report.Description += "OS: " + Util.GetWindowsVersion( ) + Environment.NewLine;

            // Show the error form with the report.
            ErrorForm form = new ErrorForm(e, report, fatal);

            form.ShowDialog( );
        }
Beispiel #2
0
        /// <summary>
        /// Creates an error report for the given exception, suitable for sending to FogBugz.
        /// </summary>
        /// <param name="fatal">Can the program execution continue after this exception?</param>
        public static BugReport CreateReportForException( Exception e, bool fatal )
        {
            // Create an error report.
            BugReport report = new BugReport
            {
                FogBugzUrl = "https://phillco.fogbugz.com/ScoutSubmit.asp",
                UserName = "******",
                Project = "LANdrop",
                Area = "Crash Reports",
                DefaultMessage = DEFAULT_BUGZSCOUT_MESSAGE,
            };

            if ( fatal )
                report.Description += "\n*** FATAL ERROR ***\n";

            report.AddMachineDetails( "\nDiscovered by" );
            report.AddExceptionDetails( e );
            report.Description += "Application version: " + Util.GetProgramVersion( ) + Environment.NewLine;
            report.Description += "OS: " + Util.GetWindowsVersion( ) + Environment.NewLine;
            return report;
        }