소스 검색

Print error if a resource can't load from script, fixes #15313

(cherry picked from commit b1ab44aa05994a19f0bae5e700c4007b870a8ecf)
Juan Linietsky 7 년 전
부모
커밋
6dced62187
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      core/bind/core_bind.cpp

+ 7 - 1
core/bind/core_bind.cpp

@@ -68,7 +68,13 @@ Ref<ResourceInteractiveLoader> _ResourceLoader::load_interactive(const String &p
 
 RES _ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p_no_cache) {
 
-	RES ret = ResourceLoader::load(p_path, p_type_hint, p_no_cache);
+	Error err = OK;
+	RES ret = ResourceLoader::load(p_path, p_type_hint, p_no_cache, &err);
+
+	if (err != OK) {
+		ERR_EXPLAIN("Error loading resource: '" + p_path + "'");
+		ERR_FAIL_COND_V(err != OK, ret);
+	}
 	return ret;
 }