From 7b6cd315e17390912ed7edbd8afebd22f2d35b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=A3=8E?= Date: Thu, 6 Sep 2012 20:43:25 +0800 Subject: [PATCH] improve error message --- lualib-src/lua-skynet.c | 2 ++ skynet-src/skynet_server.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lualib-src/lua-skynet.c b/lualib-src/lua-skynet.c index a2a0ffcb..e92f8a9a 100644 --- a/lualib-src/lua-skynet.c +++ b/lualib-src/lua-skynet.c @@ -155,6 +155,8 @@ _send(lua_State *L) { if (dest == 0) { luaL_error(L, "Invalid name %s", addrname); } + } else if ('0' <= addrname[0] && addrname[0] <= '9') { + luaL_error(L, "Invalid name %s: must not start with a digit", addrname); } else { return _sendname(L, context, addrname); } diff --git a/skynet-src/skynet_server.c b/skynet-src/skynet_server.c index a5ddd9a2..30d86a90 100644 --- a/skynet-src/skynet_server.c +++ b/skynet-src/skynet_server.c @@ -518,7 +518,7 @@ skynet_send(struct skynet_context * context, uint32_t source, uint32_t destinati if (skynet_context_push(destination, &smsg)) { free(data); - skynet_error(NULL, "Drop message from %x to %x (size=%d)", source, destination, (int)sz); + skynet_error(NULL, "Drop message from %x to %x (type=%d)(size=%d)", source, destination, type, (int)(sz & HANDLE_MASK)); return -1; } }