Skip to content

Commit

Permalink
use inline functions instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Elepover committed May 29, 2020
1 parent 3c23cf9 commit 08f16c5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pmcenter/EventHandlers/GlobalErrorHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ public static partial class EventHandlers
{
public static void GlobalErrorHandler(object sender, UnhandledExceptionEventArgs e)
{
void L(string log)
{
if (string.IsNullOrEmpty(log)) return;
Console.Error.WriteLine(log);
}
L("[!] Critical error occurred, falling back to basic logging.");
L("pmcenter's global error handler has captured a critical error.");
L("If you believe that this is a bug, feel free to open an issue with the details below on pmcenter's GitHub repository at:");
Expand All @@ -34,11 +39,5 @@ public static void GlobalErrorHandler(object sender, UnhandledExceptionEventArgs
}
Environment.Exit(Marshal.GetHRForException(exception));
}

private static void L(string log)
{
if (string.IsNullOrEmpty(log)) return;
Console.Error.WriteLine(log);
}
}
}

0 comments on commit 08f16c5

Please sign in to comment.