Skip to content

Commit

Permalink
Change exception logging to be more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
dymanoid committed Jul 7, 2018
1 parent cfcd86b commit c5c5789
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/RealTime/Config/ConfigurationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static RealTimeConfig LoadConfiguration()
}
catch (Exception ex)
{
Log.Warning($"The ' Real Time' mod has encountered an error while trying to load the configuration, error message: " + ex.Message);
Log.Warning($"The 'Real Time' mod has encountered an error while trying to load the configuration, error message: " + ex);
return new RealTimeConfig();
}
}
Expand All @@ -61,7 +61,7 @@ public static void SaveConfiguration(RealTimeConfig config)
}
catch (Exception ex)
{
Log.Error("The 'Real Time' mod cannot save its configuration, error message: " + ex.Message);
Log.Error("The 'Real Time' mod cannot save its configuration, error message: " + ex);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/RealTime/Core/RealTimeCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static RealTimeCore Run(RealTimeConfig config, string rootPath, Localizat
Log.Warning("Failed to revert method redirections while cleaning up a failed patching");
}

Log.Error("Failed to perform method redirections: " + ex.Message);
Log.Error("The 'Real Time' mod failed to perform method redirections: " + ex);
return null;
}

Expand Down Expand Up @@ -198,7 +198,7 @@ public void Stop()
}
catch (Exception ex)
{
Log.Error("Failed to revert method redirections: " + ex.Message);
Log.Error("The 'Real Time' mod failed to revert method redirections: " + ex);
}

isEnabled = false;
Expand Down
2 changes: 1 addition & 1 deletion src/RealTime/Events/Storage/CityEventsLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private void LoadEvents(IEnumerable<string> files)
}
catch (Exception ex)
{
Log.Error($"The 'Real Time' mod was unable to load an event template from file '{file}', error message: '{ex.Message}'");
Log.Error($"The 'Real Time' mod was unable to load an event template from file '{file}', error message: {ex}");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/RealTime/GameConnection/ResidentAIHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ StartMovingWithOfferDelegate startMovingWithOffer
}
catch (Exception e)
{
Log.Error($"The 'Real Time' mod failed to create a delegate for type 'ResidentAI', no method patching for the class: '{e.Message}'");
Log.Error("The 'Real Time' mod failed to create a delegate for type 'ResidentAI', no method patching for the class: " + e);
return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/RealTime/GameConnection/TouristAIHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ StartMovingDelegate startMoving
}
catch (Exception e)
{
Log.Error($"The 'Real Time' mod failed to create a delegate for type 'TouristAI', no method patching for the class: '{e.Message}'");
Log.Error("The 'Real Time' mod failed to create a delegate for type 'TouristAI', no method patching for the class: " + e);
return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/RealTime/Localization/LocalizationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private LoadingResult Load(string language)
}
catch (Exception ex)
{
Log.Error($"The 'Real Time' cannot load data from localization file '{path}', error message: {ex.Message}");
Log.Error($"The 'Real Time' cannot load data from localization file '{path}', error message: {ex}");
translation.Clear();
return LoadingResult.Failure;
}
Expand Down

0 comments on commit c5c5789

Please sign in to comment.