Skip to content

Commit 306cfd5

Browse files
committed
fix(parse_dsn) fatal string concat with nil error
1 parent fba4dfd commit 306cfd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/resty/redis/connector.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ local function parse_dsn(params)
147147

148148
local m, err = ngx_re_match(url, url_pattern, "oj")
149149
if not m then
150-
return nil, "could not parse DSN: " .. err
150+
return nil, "could not parse DSN: " .. tostring(err)
151151
end
152152

153153
local fields
@@ -172,6 +172,7 @@ local function parse_dsn(params)
172172

173173
return true, nil
174174
end
175+
_M.parse_dsn = parse_dsn
175176

176177

177178
function _M.connect(self, params)

0 commit comments

Comments
 (0)