Browse Source

Improved the error text for LÖVE’s module searchers (used in require.)

Alex Szpakowski 11 years ago
parent
commit
279cecaa6b
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/modules/filesystem/physfs/wrap_Filesystem.cpp

+ 6 - 3
src/modules/filesystem/physfs/wrap_Filesystem.cpp

@@ -493,7 +493,10 @@ int loader(lua_State *L)
 		}
 	}
 
-	lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", (tmp + ".lua").c_str());
+	std::string errstr = "\n\tno file '%s' in LOVE game directories.";
+	errstr += errstr;
+
+	lua_pushfstring(L, errstr.c_str(), (tmp + ".lua").c_str(), (tmp + "/init.lua").c_str());
 	return 1;
 }
 
@@ -529,7 +532,7 @@ int extloader(lua_State *L)
 
 	if (!handle)
 	{
-		lua_pushfstring(L, "\n\tno extension \"%s\" in LOVE paths.\n", filename);
+		lua_pushfstring(L, "\n\tno file '%s' in LOVE paths.", tokenized_name.c_str());
 		return 1;
 	}
 
@@ -540,7 +543,7 @@ int extloader(lua_State *L)
 	if (!func)
 	{
 		SDL_UnloadObject(handle);
-		lua_pushfstring(L, "\n\textension \"%s\" is incompatible.\n", filename);
+		lua_pushfstring(L, "\n\tC library '%s' is incompatible.", tokenized_name.c_str());
 		return 1;
 	}