From dab441933513214519dc63ca554be1ab11282e95 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Mon, 28 Aug 2017 16:06:51 +0800 Subject: [PATCH] catch error , see #726 --- lualib/skynet/manager.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lualib/skynet/manager.lua b/lualib/skynet/manager.lua index 4365d2e2..d2437b54 100644 --- a/lualib/skynet/manager.lua +++ b/lualib/skynet/manager.lua @@ -57,8 +57,11 @@ function skynet.forward_type(map, start_func) if prototype then dispatch_message(prototype, msg, sz, ...) else - dispatch_message(ptype, msg, sz, ...) + local ok, err = pcall(dispatch_message, ptype, msg, sz, ...) c.trash(msg, sz) + if not ok then + error(err) + end end end, true) skynet.timeout(0, function()