Thu, 07 Jan 2010 02:31:00 +0000
clix: Handle errors (including 'interrupted!') in verse.loop()
clix.lua | file | annotate | diff | comparison | revisions |
--- a/clix.lua Thu Jan 07 02:20:16 2010 +0000 +++ b/clix.lua Thu Jan 07 02:31:00 2010 +0000 @@ -81,7 +81,13 @@ conn.connect_port = account.port; -- Connect! conn:connect_client(account.jid, account.password); - return verse.loop(); + + local ok, ret = pcall(verse.loop); + if not ok and not ret:match("interrupted!$") then + io.stderr:write("Fatal error: ", ret, "\n"); + return 1; + end + return err or 0; end table.remove(arg,1);