From 93982a16c1421575a5ab199f3bcfcbb5e3faf3f3 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Mon, 10 Nov 2014 14:17:52 +0200 Subject: [PATCH] Correct error messages to be clearer --- LuaEngine.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LuaEngine.cpp b/LuaEngine.cpp index 678f94b..3fff1f3 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -350,7 +350,7 @@ void Eluna::ExecuteCall(lua_State* L, int params, int res) if (type != LUA_TFUNCTION) { lua_pop(L, params + 1); // Cleanup the stack. - ELUNA_LOG_ERROR("[Eluna]: Cannot execute call: registered value is a %s, not a function.", lua_typename(L, type)); + ELUNA_LOG_ERROR("[Eluna]: Cannot execute call: registered value is %s, not a function.", lua_typename(L, type)); return; } @@ -487,13 +487,13 @@ static int32 CheckIntegerRange(lua_State *L, int narg, int32 min, int32 max) if (value > max) { - snprintf(error_buffer, 64, "value must be less than %d", max); + snprintf(error_buffer, 64, "value must be less than or equal to %d", max); return luaL_argerror(L, narg, error_buffer); } if (value < min) { - snprintf(error_buffer, 64, "value must be greater than %d", min); + snprintf(error_buffer, 64, "value must be greater than or equal to %d", min); return luaL_argerror(L, narg, error_buffer); } @@ -506,11 +506,11 @@ static uint32 CheckUnsignedRange(lua_State *L, int narg, uint32 max) char error_buffer[64]; if (value < 0) - return luaL_argerror(L, narg, "value must be greater than 0"); + return luaL_argerror(L, narg, "value must be greater than or equal to 0"); if (value > max) { - snprintf(error_buffer, 64, "value must be less than %u", max); + snprintf(error_buffer, 64, "value must be less than or equal to %u", max); return luaL_argerror(L, narg, error_buffer); }