From 2283e072b58c6c064f801973f5ef2f315a10b8f4 Mon Sep 17 00:00:00 2001 From: Eoin O'Neill Date: Tue, 19 Dec 2023 16:17:26 -0800 Subject: [PATCH] Improve error message in text resource format parser This improves the error message in our text resource parsing code to help the user potentially fix parsing issues in case of failure. It also helps with the debugging process of finding out which sub_resource is causing the parser to fail with line messages. --- scene/resources/resource_format_text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 037cd32f10..29cd9f648d 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -281,7 +281,7 @@ Ref ResourceLoaderText::_parse_node_tag(VariantParser::ResourcePars if (error == ERR_FILE_MISSING_DEPENDENCIES) { // Resource loading error, just skip it. } else if (error != ERR_FILE_EOF) { - _printerr(); + ERR_PRINT(vformat("Parse Error: %s. [Resource file %s:%d]", error_names[error], res_path, lines)); return Ref(); } else { error = OK;