summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-03-27 21:13:46 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-13 15:27:06 -0400
commit20912724a0dc61562ea00e12e9bbc472c93e6aa4 (patch)
treed04b499b0d2a9c7ce3318584a5a8ee8094b346c6 /src/SMAPI
parent29d11a72c27c659b95e8d5eaa8b41463c2371638 (diff)
downloadSMAPI-20912724a0dc61562ea00e12e9bbc472c93e6aa4.tar.gz
SMAPI-20912724a0dc61562ea00e12e9bbc472c93e6aa4.tar.bz2
SMAPI-20912724a0dc61562ea00e12e9bbc472c93e6aa4.zip
fix errors during early startup not shown before exit
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Program.cs16
1 files changed, 12 insertions, 4 deletions
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);
+ }
}