From 9193035767597475133a639c2f5145eee828867f Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Mon, 1 Jul 2019 20:26:53 +0800 Subject: [PATCH] Improve error message , see issue #1050 --- lualib-src/lua-cluster.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lualib-src/lua-cluster.c b/lualib-src/lua-cluster.c index 47c6592d..a050f3c0 100644 --- a/lualib-src/lua-cluster.c +++ b/lualib-src/lua-cluster.c @@ -111,7 +111,11 @@ packreq_string(lua_State *L, int session, void * msg, uint32_t sz, int is_push) const char *name = lua_tolstring(L, 1, &namelen); if (name == NULL || namelen < 1 || namelen > 255) { skynet_free(msg); - luaL_error(L, "name is too long %s", name); + if (name == NULL) { + luaL_error(L, "name is not a string, it's a %s", lua_typename(L, lua_type(L, 1))); + } else { + luaL_error(L, "name is too long %s", name); + } } uint8_t buf[TEMP_LENGTH];