Explorar o código

Merge pull request #79737 from Calinou/resourceloader-load-error-clarify-expected-type

Mention expected resource type in ResourceLoader load error
Yuri Sizov %!s(int64=2) %!d(string=hai) anos
pai
achega
0be587521e
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      core/io/resource_loader.cpp

+ 2 - 2
core/io/resource_loader.cpp

@@ -275,10 +275,10 @@ Ref<Resource> ResourceLoader::_load(const String &p_path, const String &p_origin
 
 #ifdef TOOLS_ENABLED
 	Ref<FileAccess> file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES);
-	ERR_FAIL_COND_V_MSG(!file_check->file_exists(p_path), Ref<Resource>(), "Resource file not found: " + p_path + ".");
+	ERR_FAIL_COND_V_MSG(!file_check->file_exists(p_path), Ref<Resource>(), vformat("Resource file not found: %s (expected type: %s)", p_path, p_type_hint));
 #endif
 
-	ERR_FAIL_V_MSG(Ref<Resource>(), "No loader found for resource: " + p_path + ".");
+	ERR_FAIL_V_MSG(Ref<Resource>(), vformat("No loader found for resource: %s (expected type: %s)", p_path, p_type_hint));
 }
 
 void ResourceLoader::_thread_load_function(void *p_userdata) {