Add error handling for Discord callback.

This commit is contained in:
2023-01-13 22:16:16 +08:00
parent 1d3aa85446
commit 5b14466059

View File

@@ -34,7 +34,14 @@ namespace Cryville.Crtr {
void Update() {
if (dc == null) return;
dc.RunCallbacks();
try {
dc.RunCallbacks();
}
catch (ResultException ex) {
dc.Dispose();
dc = null;
Logger.Log("main", 4, "Discord", "An error occured while running callbacks: {0}", ex);
}
}
void OnApplicationQuit() {