Change error message when failing to load json

This commit is contained in:
Nick 2022-06-19 19:33:47 -04:00
parent 268c18386c
commit 901ad1d945

View File

@ -462,6 +462,11 @@ namespace NewHorizons
try
{
var config = mod.ModHelper.Storage.Load<PlanetConfig>(relativeDirectory);
if (config == null)
{
Logger.LogError($"Couldn't load {relativeDirectory}. Is your Json formatted correctly?");
return null;
}
Logger.Log($"Loaded {config.name}");
@ -488,7 +493,7 @@ namespace NewHorizons
}
catch (Exception e)
{
Logger.LogError($"Couldn't load {relativeDirectory}: {e.Message} {e.StackTrace}, is your Json formatted correctly?");
Logger.LogError($"Error encounter when loading {relativeDirectory}: {e.Message} {e.StackTrace}");
}
return body;