mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 08:33:19 +01:00
Merge pull request #641 from Cyberboss/WatchdogStartupFailMessage
Send an error message to chat when watchdog startup fails
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user