Skip to content

Commit 1b73826

Browse files
committed
change: better error when request context couldn't be found.
1 parent ddf9dac commit 1b73826

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/resty/core/socket_tcp.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ local FFI_ERROR = base.FFI_ERROR
88
local FFI_DONE = base.FFI_DONE
99
local FFI_OK = base.FFI_OK
1010
local FFI_AGAIN = base.FFI_AGAIN
11+
local FFI_NO_REQ_CTX = base.FFI_NO_REQ_CTX
1112
local get_request = base.get_request
1213
local error = error
1314
local assert = assert
@@ -85,6 +86,10 @@ local function tlshandshake(self, options)
8586
and 1 or 0,
8687
errmsg)
8788

89+
if rc == FFI_NO_REQ_CTX then
90+
error("no request ctx found", 2)
91+
end
92+
8893
::again::
8994

9095
if rc == FFI_ERROR then

0 commit comments

Comments
 (0)