Return error when no ResourceFormatLoader found.

This commit is contained in:
Summersay415 2024-08-14 11:45:23 +07:00
parent 06fbc8395b
commit 6df3621b47
1 changed files with 4 additions and 0 deletions

View File

@ -280,6 +280,10 @@ Ref<Resource> ResourceLoader::_load(const String &p_path, const String &p_origin
return res; return res;
} }
if (r_error) {
*r_error = ERR_FILE_UNRECOGNIZED;
}
ERR_FAIL_COND_V_MSG(found, Ref<Resource>(), ERR_FAIL_COND_V_MSG(found, Ref<Resource>(),
vformat("Failed loading resource: %s. Make sure resources have been imported by opening the project in the editor at least once.", p_path)); vformat("Failed loading resource: %s. Make sure resources have been imported by opening the project in the editor at least once.", p_path));