Merge pull request #33201 from Xrayez/json-err-print

Provide and print error messages for JSON parsing
This commit is contained in:
Rémi Verschelde 2019-10-31 13:31:48 +01:00 committed by GitHub
commit 55fd63d9de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -3165,6 +3165,9 @@ Ref<JSONParseResult> _JSON::parse(const String &p_json) {
result->error = JSON::parse(p_json, result->result, result->error_string, result->error_line); result->error = JSON::parse(p_json, result->result, result->error_string, result->error_line);
if (result->error != OK) {
ERR_PRINTS(vformat("Error parsing JSON at line %s: %s", result->error_line, result->error_string));
}
return result; return result;
} }

View File

@ -1274,6 +1274,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (err != OK) { if (err != OK) {
r_ret = Variant(); r_ret = Variant();
ERR_PRINTS(vformat("Error parsing JSON at line %s: %s", errl, errs));
} }
} break; } break;