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

Mention expected resource type in ResourceLoader load error
This commit is contained in:
Yuri Sizov 2023-07-31 21:01:28 +02:00
commit 0be587521e
1 changed files with 2 additions and 2 deletions

View File

@ -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) {