summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Events.cs
diff options
context:
space:
mode:
authorZoryn Aaron <zoryn4163@gmail.com>2016-02-29 15:01:41 -0500
committerZoryn Aaron <zoryn4163@gmail.com>2016-02-29 15:01:41 -0500
commitaef67f7e02209dfbf0507b9eb78ad7203ec88698 (patch)
tree27937a7377f9f98c4c9351e684cb2eda924e6a1f /StardewModdingAPI/Events.cs
parent150e2000cec5949a17506aa7bb47da9bcf4eb93d (diff)
downloadSMAPI-aef67f7e02209dfbf0507b9eb78ad7203ec88698.tar.gz
SMAPI-aef67f7e02209dfbf0507b9eb78ad7203ec88698.tar.bz2
SMAPI-aef67f7e02209dfbf0507b9eb78ad7203ec88698.zip
crash handling
Diffstat (limited to 'StardewModdingAPI/Events.cs')
-rw-r--r--StardewModdingAPI/Events.cs36
1 files changed, 32 insertions, 4 deletions
diff --git a/StardewModdingAPI/Events.cs b/StardewModdingAPI/Events.cs
index 07be29a6..d4311ac3 100644
--- a/StardewModdingAPI/Events.cs
+++ b/StardewModdingAPI/Events.cs
@@ -31,22 +31,50 @@ namespace StardewModdingAPI
public static void InvokeInitialize()
{
- Initialize.Invoke();
+ try
+ {
+ Initialize.Invoke();
+ }
+ catch (Exception ex)
+ {
+ Program.LogError("An exception occured in XNA Initialize: " + ex.ToString());
+ }
}
public static void InvokeLoadContent()
{
- LoadContent.Invoke();
+ try
+ {
+ LoadContent.Invoke();
+ }
+ catch (Exception ex)
+ {
+ Program.LogError("An exception occured in XNA LoadContent: " + ex.ToString());
+ }
}
public static void InvokeUpdateTick()
{
- UpdateTick.Invoke();
+ try
+ {
+ UpdateTick.Invoke();
+ }
+ catch (Exception ex)
+ {
+ Program.LogError("An exception occured in XNA UpdateTick: " + ex.ToString());
+ }
}
public static void InvokeDrawTick()
{
- DrawTick.Invoke();
+ try
+ {
+ DrawTick.Invoke();
+ }
+ catch (Exception ex)
+ {
+ Program.LogError("An exception occured in XNA DrawTick: " + ex.ToString());
+ }
}
public static void InvokeKeyboardChanged(KeyboardState newState)