Skip to content

Commit

Permalink
Merge pull request #79737 from Calinou/resourceloader-load-error-clar…
Browse files Browse the repository at this point in the history
…ify-expected-type

Mention expected resource type in ResourceLoader load error
  • Loading branch information
YuriSizov committed Jul 31, 2023
2 parents 9fbb349 + 5bf6425 commit 0be5875
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/io/resource_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0be5875

Please sign in to comment.