Dwarrowdelf.ExceptionHelper.DumpException C# (CSharp) Method

DumpException() public static method

public static DumpException ( Exception e, string header ) : void
e System.Exception
header string
return void
        public static void DumpException(Exception e, string header)
        {
            var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory),
                "dwarrowdelf-crash.txt");

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0}=== {1} ==={2}", Environment.NewLine, header, Environment.NewLine);

            sb.AppendLine(DateTime.Now.ToString());

            sb.AppendLine(e.ToString());

            File.AppendAllText(path, sb.ToString());
        }
ExceptionHelper