SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Fix game exception log detection

Pathoschild opened this issue ยท 1 comments

commented

Stardew Valley 1.3 sometimes logs the exception message and stack trace separately. Since the log parser checks for the word 'exception', it the error details are hidden in trace messages.

For example (see full log):

17:07:06 | ERROR | game | System.NullReferenceException
17:07:06 | TRACE | game | Object reference not set to an instance of an object.
17:07:06 | TRACE | game | at StardewValley.Locations.DecoratableLocation.doSetVisibleWallpaper(Int32 whichRoom, Int32 which) in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\1\chucklefish\stardewvalley\Farmer\Farmer\Locations\DecoratableLocation.cs:line 490    at StardewValley.Locations.DecoratableLocation.setWallpapers() in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\1\chucklefish\stardewvalley\Farmer\Farmer\Locations\DecoratableLocation.cs:line 435    at StardewValley.Locations.FarmHouse.resetLocalState() in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\1\chucklefish\stardewvalley\Farmer\Farmer\Locations\FarmHouse.cs:line 652    at StardewValley.GameLocation.<resetForPlayerEntry>b__182_0() in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\1\chucklefish\stardewvalley\Farmer\Farmer\Locations\GameLocation.cs:line 3401    at StardewValley.ModHooks.OnGameLocation_ResetForPlayerEntry(GameLocation location, Action action) in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\1\chucklefish\stardewvalley\Farmer\Farmer\ModHooks.cs:line 12    at StardewValley.GameLocation.resetForPlayerEntry() in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\1\chucklefish\stardewvalley\Farmer\Farmer\Locations\GameLocation.cs:line 3397    at StardewValley.SaveGame.loadDataToLocations(List`1 gamelocations) in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\1\chucklefish\stardewvalley\Farmer\Farmer\SaveGame.cs:line 1370    at StardewValley.SaveGame.<>c.<getLoadEnumerator>b__55_3() in C:\Users\gitlab-runner\gitlab-runner\builds\5c0f9387\1\chucklefish\stardewvalley\Farmer\Farmer\SaveGame.cs:line 1008    at System.Threading.Tasks.Task.InnerInvoke()    at System.Threading.Tasks.Task.Execute()
commented

These messages are logged separately, which makes it harder to intercept. I added a modding wishlist entry to log exceptions as one message.