mirror of https://github.com/Jackett/Jackett
Global exception catcher
This commit is contained in:
parent
47580ec726
commit
9cb9b859a8
|
@ -19,11 +19,12 @@ namespace Jackett.Updater
|
|||
{
|
||||
private IProcessService processService;
|
||||
private IServiceConfigService windowsService;
|
||||
private Logger logger;
|
||||
public static Logger logger;
|
||||
private Variants.JackettVariant variant = Variants.JackettVariant.NotFound;
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper;
|
||||
new Program().Run(args);
|
||||
}
|
||||
|
||||
|
@ -523,5 +524,12 @@ namespace Jackett.Updater
|
|||
return Path.Combine(directoryPath, "JackettConsole.exe");
|
||||
}
|
||||
}
|
||||
|
||||
private static void UnhandledExceptionTrapper(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
Console.WriteLine(e.ExceptionObject.ToString());
|
||||
logger.Error(e.ExceptionObject.ToString());
|
||||
Environment.Exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue