catch error , see #726

This commit is contained in:
Cloud Wu
2017-08-28 16:06:51 +08:00
parent 932ebfa0fd
commit dab4419335

View File

@@ -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()