Skip to content

Commit

Permalink
[CLI] Only redirect exceptions for Release
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperbx committed Nov 27, 2021
1 parent 6c6d99a commit b43a6e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Marathon.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ static void Main(string[] args)
"All your '06 formats are belong to us.\n"
);

#if !DEBUG
// Log to file if an unhandled exception occurs.
AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
{
File.WriteAllText($"{AssemblyExtensions.GetAssemblyName()}.log", ((Exception)e.ExceptionObject).CreateLog());
};
#endif

// Force culture info 'en-GB' to prevent errors with values altered by culture-specific differences.
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-GB");
Expand Down

0 comments on commit b43a6e1

Please sign in to comment.