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:
Uli Schlachter 2017-01-02 16:10:38 +01:00
parent 4c322a613f
commit 0f755c8f12
1 changed files with 1 additions and 1 deletions

View File

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