فهرست منبع

JsonParser::parse(): Print JSON if there were errors while parsing

In cases where the file name was not specified, the warning messages were not very useful.

Example:

```json
File <unknown> is not a valid JSON file!
At line 33, position 1 warning: Comma expected!

{
        "name" : "New Old Heroes",
        "description" : "New heroes based on old 3DO artwork and other game appearances. Requires Horn of the Abyss.",
        "modType" : "Heroes",
        "version" : "1.2.0",
        "author" : "Aphra",
        "contact" : "",

        "heroes" :
        [
                "config/gwenneth.json",
                "config/balindar.json",
                "config/nicolas.json",
                "config/kastore.json",
                "config/kydoimos.json",
                "config/athe.json",
                "config/miseria.json",
                "config/areshrak.json",
                "config/pactal.json",
                "config/zog.json"
        ],

        "changelog" :
    {
        "1.0.0"   : ["Initial release"],
        "1.1.0"   : ["Added Nicolas Gryphonheart and Kastore"],
        "1.1.1"   : ["Bug fixes"],
        "1.2.0"   : ["Added some HotA portrait-only campaign heroes"]
    },

        "depends" :
                [ "hota.neutralCreatures" ]
        "keepDisabled" : true
}
```
Alexander Wilms 1 سال پیش
والد
کامیت
1ca8e9b3ae
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      lib/json/JsonParser.cpp

+ 1 - 0
lib/json/JsonParser.cpp

@@ -57,6 +57,7 @@ JsonNode JsonParser::parse(const std::string & fileName)
 	{
 		logMod->warn("File %s is not a valid JSON file!", fileName);
 		logMod->warn(errors);
+		logMod->warn("%s", input);
 	}
 	return root;
 }