mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
added common global exception handler.
This commit is contained in:
parent
89082ea94e
commit
53c32fbe10
4 changed files with 38 additions and 12 deletions
|
@ -16,12 +16,13 @@ namespace NzbDrone
|
|||
{
|
||||
try
|
||||
{
|
||||
GlobalExceptionHandlers.Register();
|
||||
|
||||
new LogglyTarget(new EnvironmentProvider()).Register(LogLevel.Warn);
|
||||
ExceptronTarget.Register();
|
||||
|
||||
|
||||
logger.Info("Starting NzbDrone Console. Version {0}", Assembly.GetExecutingAssembly().GetName().Version);
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += ((s, e) => AppDomainException(e.ExceptionObject as Exception));
|
||||
|
||||
//Check if full version .NET is installed.
|
||||
try
|
||||
|
@ -61,14 +62,9 @@ namespace NzbDrone
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
AppDomainException(e);
|
||||
logger.FatalException("Epic Fail " + e.Message, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void AppDomainException(Exception exception)
|
||||
{
|
||||
Console.WriteLine("EPIC FAIL: {0}", exception);
|
||||
logger.FatalException("EPIC FAIL: " + exception.Message, exception);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue