From 449974ca6148c67b7167c856b5fb102847ef644e Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 4 Apr 2016 20:04:19 +0200 Subject: [PATCH] luaA_checkscreen: display number of existing screens with error This is meant to be helpful in the case of 0 existing screens, e.g. during executing the config initially. --- objects/screen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/objects/screen.c b/objects/screen.c index c7e508b71..c4a0ee586 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -107,7 +107,8 @@ luaA_checkscreen(lua_State *L, int sidx) { int screen = lua_tointeger(L, sidx); if(screen < 1 || screen > globalconf.screens.len) - luaL_error(L, "invalid screen number: %d", screen); + luaL_error(L, "invalid screen number: %d (of %d existing)", + screen, globalconf.screens.len); return globalconf.screens.tab[screen - 1]; } else return luaA_checkudata(L, sidx, &screen_class);