浏览代码

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.
Eoin O'Neill 1 年之前
父节点
当前提交
2283e072b5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/resources/resource_format_text.cpp

+ 1 - 1
scene/resources/resource_format_text.cpp

@@ -281,7 +281,7 @@ Ref<PackedScene> 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<PackedScene>();
 					} else {
 						error = OK;