diff --git a/Torch.Server/Initializer.cs b/Torch.Server/Initializer.cs index c88e617f..91731117 100644 --- a/Torch.Server/Initializer.cs +++ b/Torch.Server/Initializer.cs @@ -279,7 +279,15 @@ private void HandleException(object sender, UnhandledExceptionEventArgs e) } else { - MessageBox.Show("Torch encountered a fatal error and needs to close. Please check the logs for details."); + if (!this.Config.NoGui) + { + MessageBox.Show( + "Torch encountered a fatal error and needs to close. Please check the logs for details."); + } + else + { + Log.Error("Torch encountered a fatal error and needs to close. Please check the logs for details."); + } } Process.GetCurrentProcess().Kill();