From 5bf64255b06df4a34515516c6d6d7a1f0d49b4e3 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 21 Jul 2023 04:45:34 +0200 Subject: [PATCH] Mention expected resource type in ResourceLoader load error This helps troubleshoot issues due to incorrect import types. --- core/io/resource_loader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 1fe662b1fad2..df0253349c16 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -275,10 +275,10 @@ Ref ResourceLoader::_load(const String &p_path, const String &p_origin #ifdef TOOLS_ENABLED Ref file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES); - ERR_FAIL_COND_V_MSG(!file_check->file_exists(p_path), Ref(), "Resource file not found: " + p_path + "."); + ERR_FAIL_COND_V_MSG(!file_check->file_exists(p_path), Ref(), vformat("Resource file not found: %s (expected type: %s)", p_path, p_type_hint)); #endif - ERR_FAIL_V_MSG(Ref(), "No loader found for resource: " + p_path + "."); + ERR_FAIL_V_MSG(Ref(), vformat("No loader found for resource: %s (expected type: %s)", p_path, p_type_hint)); } void ResourceLoader::_thread_load_function(void *p_userdata) {