# HG changeset patch # User Matthew Wild # Date 1262831460 0 # Node ID a502c905527c44fc1217c53f47c3f23a6540a311 # Parent 49b83fa1f6fd3f085bff96562e53730de8b7babc clix: Handle errors (including 'interrupted!') in verse.loop() diff -r 49b83fa1f6fd -r a502c905527c clix.lua --- 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);