From b73b8d0987ebb3ead57ee7c808557a9819a9539b Mon Sep 17 00:00:00 2001 From: Rich Dunne Date: Wed, 7 Jul 2021 07:30:06 -0600 Subject: [PATCH] Added try/catch for autosave --- SceneManager/EntryPoint.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SceneManager/EntryPoint.cs b/SceneManager/EntryPoint.cs index 1ee02e6..8899c6e 100644 --- a/SceneManager/EntryPoint.cs +++ b/SceneManager/EntryPoint.cs @@ -42,11 +42,20 @@ namespace SceneManager private static void TerminationHandler(object sender, EventArgs e) { + try + { + ExportPathMenu.ExportOnUnload(); + } + catch(Exception ex) + { + Game.LogTrivial($"Autosave error: {ex.Message}"); + Game.DisplayNotification($"~o~Scene Manager ~r~[Error]\n~w~There was a problem autosaving the paths."); + } BarrierMenu.Cleanup(); PathManager.DeleteAllPaths(); Game.LogTrivial($"Plugin has shut down."); - Game.DisplayNotification($"~o~Scene Manager ~r~[Terminated]\n~w~The plugin has shut down."); + //Game.DisplayNotification($"~o~Scene Manager ~r~[Terminated]\n~w~The plugin has shut down."); } } }