From 150e2000cec5949a17506aa7bb47da9bcf4eb93d Mon Sep 17 00:00:00 2001 From: Zoryn Aaron Date: Mon, 29 Feb 2016 13:39:21 -0500 Subject: [PATCH] error catching --- Release/StardewModdingAPI.exe | Bin 52736 -> 53248 bytes StardewModdingAPI/Program.cs | 26 ++++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Release/StardewModdingAPI.exe b/Release/StardewModdingAPI.exe index 8e4d987e26fce4b739840baa1918ad3f99aee10e..d1132026c6df261536f37045772eccb1d20af4fa 100644 GIT binary patch delta 13657 zcmc(G33yaRy7pIfx=%Wtq|@C=I$N*l1`cTg1cDfrfdD}eP#I9bQ6WMGB1mHgxC$nn zs0`wOibv5w)Bqxa3rj>mRB#zbeq0b0$5A#N#|2SQ(Q&zO->P$x4gvN4|1;0?NBceB z`)&1|sybEGC!t}5($J*besj_Jx4(4>nLme#vow}Q^aKD`n(J*YUO zG=d${=PN z%#@SrDezh^8nZ`9jrky?M|-w}BPQmDiUMiz8lqWT3xIi+AUo3zh)kl5@sKW68Mw&072L?G>K~XoB_pZp znj!u89;R=~45M*XpJ%A_drh}p8Ad@Lw+VAQjPyMn$y8SuIyOH3o)|*~?Os}sT zMyA}%WYnNcBhzH5E6{Jv%<-eUnCSlEc@#g&X_j^ex|VDGfXd>&`g56G(Z641dV$Yn z=Ib4uIgt7}TX%@{SR(2BH0+FLdn;*a#i2wHb(86HadTn)bT=#J~|^T2lpyNrT;n0NVPG`NcE1% z#RTBlMyhbO;d3}!ZN4D8l8ITszp=>CeKBXUoD@Ah$^O5>V@!Yn*47EI-cad#q?@Dp zGtYahUpGu)IVOJIAmrj(slEtTPppS{Afz0_18a{jveK+rnNSuJWp!65ptJm}MD|Jb zS@CS01B=#MnDexA#YHOz!upJ`;@PyvF#gCGM0PRecF##>S4+|iMgOGjcMy|?0bm`q zfxuV=KpP}r3v!Z%B}`42PwD$Y6F-C+O~t`hmw3L4i6Ne7Z7`rAf&%IV#4BLPjSUgX z4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.cs +++ b/StardewModdingAPI/Program.cs @@ -27,6 +27,7 @@ namespace StardewModdingAPI public static string ExecutionPath { get; private set; } public static string DataPath = Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley")); public static string ModPath = Path.Combine(Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley")), "Mods"); + public static string LogPath = Path.Combine(Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley")), "ErrorLogs"); public static SGame gamePtr; public static bool ready; @@ -48,7 +49,9 @@ namespace StardewModdingAPI { Console.Title = "Stardew Modding API Console"; - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); + Application.ThreadException += Application_ThreadException; + Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); + AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; if (File.Exists(ModPath)) File.Delete(ModPath); @@ -97,6 +100,8 @@ namespace StardewModdingAPI Events.InvokeGameLoaded(); } + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -193,19 +198,16 @@ namespace StardewModdingAPI StardewForm.Invoke(a); } - public static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) + static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { - string dllName = args.Name.Contains(',') ? args.Name.Substring(0, args.Name.IndexOf(',')) : args.Name.Replace(".dll", ""); + Console.WriteLine("An exception has been caught"); + File.WriteAllText(Program.LogPath + "\\MODDED_ErrorLog_" + Extensions.Random.Next(100000000, 999999999) + ".txt", e.ExceptionObject.ToString()); + } - dllName = dllName.Replace(".", "_"); - - if (dllName.EndsWith("_resources")) return null; - - System.Resources.ResourceManager rm = new System.Resources.ResourceManager(typeof(Program).Namespace + ".Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly()); - - byte[] bytes = (byte[])rm.GetObject(dllName); - - return System.Reflection.Assembly.Load(bytes); + static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + { + Console.WriteLine("A thread exception has been caught"); + File.WriteAllText(Program.LogPath + "\\MODDED_ErrorLog_" + Extensions.Random.Next(100000000, 999999999) + ".txt", e.Exception.ToString()); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////