From 6001d9c2ebeea36253a3bdcf7fdcf998f2723d09 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Fri, 26 Jun 2015 14:33:33 +0800 Subject: [PATCH] raise error message from response function, See issue #295 --- lualib/socketchannel.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lualib/socketchannel.lua b/lualib/socketchannel.lua index 4b90193b..282e6283 100644 --- a/lualib/socketchannel.lua +++ b/lualib/socketchannel.lua @@ -303,7 +303,11 @@ local function wait_for_response(self, response) self.__result_data[co] = nil if result == socket_error then - error(socket_error) + if result_data then + error(result_data) + else + error(socket_error) + end else assert(result, result_data) return result_data