diff options
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI/Program.cs | 16 |
2 files changed, 13 insertions, 4 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 5ba19e43..b22909f7 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -4,6 +4,7 @@ These changes have not been released yet. * For players: * SMAPI now prevents invalid items from breaking menus on hover. + * Fixed errors during early startup not shown before exit. * For modders: * `this.Monitor.Log` now defaults to the `Trace` log level instead of `Debug`. diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 2eec371c..3a34872a 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -30,10 +30,18 @@ namespace StardewModdingAPI /// <param name="args">The command-line arguments.</param> public static void Main(string[] args) { - AppDomain.CurrentDomain.AssemblyResolve += Program.CurrentDomain_AssemblyResolve; - Program.AssertGamePresent(); - Program.AssertGameVersion(); - Program.Start(args); + try + { + AppDomain.CurrentDomain.AssemblyResolve += Program.CurrentDomain_AssemblyResolve; + Program.AssertGamePresent(); + Program.AssertGameVersion(); + Program.Start(args); + } + catch (Exception ex) + { + Console.WriteLine($"SMAPI failed to initialise: {ex}"); + Program.PressAnyKeyToExit(true); + } } |