On failure, exit with a message instead of blocking indefinitely.
This commit is contained in:
parent
38b99b80a2
commit
195b2a74bb
1 changed files with 4 additions and 2 deletions
|
@ -24,12 +24,14 @@ if ok ~= 0 then
|
||||||
print("send of zero failed with:", ok, emsg)
|
print("send of zero failed with:", ok, emsg)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assert(r:settimeout(2))
|
||||||
|
|
||||||
ok, emsg = r:receive()
|
ok, emsg = r:receive()
|
||||||
|
|
||||||
if not ok or string.len(ok) ~= 0 then
|
if not ok or string.len(ok) ~= 0 then
|
||||||
print("receive of zero failed with:", ok, emsg)
|
print("fail - receive of zero failed with:", ok, emsg)
|
||||||
|
os.exit(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
print"ok"
|
print"ok"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue