From 58ed3037c00912f1f573b8ce0d8efe6f8a50cb67 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 22 Aug 2020 22:19:08 +0200 Subject: [PATCH] Improve the resource loading error message to mention the need to import This is a common pitfall when setting up projects in a headless environment. --- core/io/resource_loader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 534f3e44deee..a5c9a78c93c1 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -195,7 +195,8 @@ RES ResourceLoader::_load(const String &p_path, const String &p_original_path, c return res; } - ERR_FAIL_COND_V_MSG(found, RES(), "Failed loading resource: " + p_path + "."); + ERR_FAIL_COND_V_MSG(found, RES(), + vformat("Failed loading resource: %s. Make sure resources have been imported by opening the project in the editor at least once.", p_path)); #ifdef TOOLS_ENABLED FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES);