mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 10:08:39 +00:00
Properly handle exceptions in DebugWarmupLifetime
This commit is contained in:
parent
d03179997a
commit
dd3e24f933
1 changed files with 10 additions and 1 deletions
|
@ -38,7 +38,16 @@ public class DebugWarmupLifetime : IHostLifetime
|
||||||
using HttpClient client = new();
|
using HttpClient client = new();
|
||||||
|
|
||||||
Logger.Log("Warming up Hot Reload...", LoggerLevelStartup.Instance);
|
Logger.Log("Warming up Hot Reload...", LoggerLevelStartup.Instance);
|
||||||
|
try
|
||||||
|
{
|
||||||
client.GetAsync(ServerSettings.Instance.ServerListenUrl).Wait();
|
client.GetAsync(ServerSettings.Instance.ServerListenUrl).Wait();
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
Logger.Log("An error occurred while attempting to warm up hot reload. Initial page load will be delayed.", LoggerLevelStartup.Instance);
|
||||||
|
Logger.Log(e.Message, LoggerLevelStartup.Instance);
|
||||||
|
return;
|
||||||
|
}
|
||||||
Logger.Log("Hot Reload is ready to go!", LoggerLevelStartup.Instance);
|
Logger.Log("Hot Reload is ready to go!", LoggerLevelStartup.Instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue