Improve error message , see issue
@@ -111,8 +111,12 @@ 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);
+ 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];
if (sz < MULTI_PART) {
