diff options
author | Andrii Doroshenko (Xrayez) <xrayez@gmail.com> | 2019-10-31 13:15:44 +0200 |
---|---|---|
committer | Andrii Doroshenko (Xrayez) <xrayez@gmail.com> | 2019-10-31 13:15:44 +0200 |
commit | 56925b9c28420d80dc343fe801177da737278d32 (patch) | |
tree | cb18bf5e403929bf0654e87a5142b9a526c9748b | |
parent | aa96481c8fe350d7223304589f1256e2b9ae8e2b (diff) |
Provide and print error messages for JSON parsing
Core is not touched, only for binding and scripting.
-rw-r--r-- | core/bind/core_bind.cpp | 3 | ||||
-rw-r--r-- | modules/gdscript/gdscript_functions.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 1d451b2982..c539f912aa 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -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); + if (result->error != OK) { + ERR_PRINTS(vformat("Error parsing JSON at line %s: %s", result->error_line, result->error_string)); + } return result; } diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index c4c7ba5ef7..185eb6c3fc 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -1274,6 +1274,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ if (err != OK) { r_ret = Variant(); + ERR_PRINTS(vformat("Error parsing JSON at line %s: %s", errl, errs)); } } break; |