Treefrog.Program.HandleException C# (CSharp) Method

HandleException() private static method

private static HandleException ( Exception e ) : void
e System.Exception
return void
        private static void HandleException(Exception e)
        {
            if (CurrentProject != null)
            {
                if (!Directory.Exists("recovery"))
                    Directory.CreateDirectory("recovery");

                string filePath = "recovery/" + (CurrentProject.Name ?? "project.tlpx");
                using (FileStream fstr = File.OpenWrite(filePath))
                {
                    CurrentProject.Save(fstr, new FileProjectResolver(filePath));
                }
            }

            ExceptionReporter reporter = new ExceptionReporter();

            reporter.Config.ShowSysInfoTab = false;
            reporter.Config.ShowConfigTab = false;
            reporter.Config.EmailReportAddress = "[email protected]";
            reporter.Config.TitleText = "Treefrog Crash";
            reporter.Config.UserExplanationLabel = "Enter a brief description leading up to the crash.  Your project has been saved to /recovery.";

            reporter.Show(e);

            Application.Exit();
        }