diff options
Diffstat (limited to 'src/SMAPI/Framework/Serialisation/JsonHelper.cs')
-rw-r--r-- | src/SMAPI/Framework/Serialisation/JsonHelper.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/SMAPI/Framework/Serialisation/JsonHelper.cs b/src/SMAPI/Framework/Serialisation/JsonHelper.cs index f66f9dfb..90a6d258 100644 --- a/src/SMAPI/Framework/Serialisation/JsonHelper.cs +++ b/src/SMAPI/Framework/Serialisation/JsonHelper.cs @@ -63,11 +63,16 @@ namespace StardewModdingAPI.Framework.Serialisation { return this.Deserialise<TModel>(json); } - catch (JsonReaderException ex) + catch (Exception ex) { - string error = $"The file at {fullPath} doesn't seem to be valid JSON."; - if (json.Contains("“") || json.Contains("”")) - error += " Found curly quotes in the text; note that only straight quotes are allowed in JSON."; + string error = $"Can't parse JSON file at {fullPath}."; + + if (ex is JsonReaderException) + { + error += " This doesn't seem to be valid JSON."; + if (json.Contains("“") || json.Contains("”")) + error += " Found curly quotes in the text; note that only straight quotes are allowed in JSON."; + } error += $"\nTechnical details: {ex.Message}"; throw new JsonReaderException(error); } |