Comparison

clix.lua @ 11:a502c905527c

clix: Handle errors (including 'interrupted!') in verse.loop()
author Matthew Wild <mwild1@gmail.com>
date Thu, 07 Jan 2010 02:31:00 +0000
parent 8:df4cb4a73549
child 13:751db005032e
comparison
equal deleted inserted replaced
10:49b83fa1f6fd 11:a502c905527c
79 -- Optional config parameters 79 -- Optional config parameters
80 conn.connect_host = account.address; 80 conn.connect_host = account.address;
81 conn.connect_port = account.port; 81 conn.connect_port = account.port;
82 -- Connect! 82 -- Connect!
83 conn:connect_client(account.jid, account.password); 83 conn:connect_client(account.jid, account.password);
84 return verse.loop(); 84
85 local ok, ret = pcall(verse.loop);
86 if not ok and not ret:match("interrupted!$") then
87 io.stderr:write("Fatal error: ", ret, "\n");
88 return 1;
89 end
90 return err or 0;
85 end 91 end
86 92
87 table.remove(arg,1); 93 table.remove(arg,1);
88 94
89 local opts = {}; 95 local opts = {};