Fix error handling in _client.lua
Previously we got the following unhelpful error message: tests/_client.lua:98: bad argument #2 to 'assert' (string expected, got userdata) Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
4c322a613f
commit
0f755c8f12
|
@ -94,7 +94,7 @@ return function(class, title, sn_rules, callback)
|
||||||
local snid = (sn_rules or callback) and get_snid(sn_rules, callback) or ""
|
local snid = (sn_rules or callback) and get_snid(sn_rules, callback) or ""
|
||||||
local data = class .. "\n" .. title .. "\n" .. snid .. "\n"
|
local data = class .. "\n" .. title .. "\n" .. snid .. "\n"
|
||||||
local success, msg = pipe:write_all(data)
|
local success, msg = pipe:write_all(data)
|
||||||
assert(success, msg)
|
assert(success, tostring(msg))
|
||||||
|
|
||||||
return snid
|
return snid
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue