Merge pull request #641 from Cyberboss/WatchdogStartupFailMessage

Send an error message to chat when watchdog startup fails
This commit is contained in:
Jordan Brown
2018-09-13 20:37:35 -04:00
committed by GitHub
@@ -735,6 +735,13 @@ namespace Tgstation.Server.Host.Components.Watchdog
}
catch (Exception e)
{
var originalChatTask = chatTask;
async Task ChainChatTaskWithErrorMessage()
{
await originalChatTask.ConfigureAwait(false);
await chat.SendWatchdogMessage("Startup failed!", cancellationToken).ConfigureAwait(false);
}
chatTask = ChainChatTaskWithErrorMessage();
logger.LogWarning("Failed to start watchdog: {0}", e.ToString());
throw;
}