Comparison

net/server_epoll.lua @ 10990:03e76ad725b2

net.server_epoll: ... and include a traceback
author Kim Alvefur <zash@zash.se>
date Tue, 30 Jun 2020 17:34:39 +0200
parent 10989:b824fe9d0c8b
child 10991:aa85cb5b859f
comparison
equal deleted inserted replaced
10989:b824fe9d0c8b 10990:03e76ad725b2
122 next_delay = peek - elapsed; 122 next_delay = peek - elapsed;
123 break; 123 break;
124 end 124 end
125 125
126 local _, timer, id = timers:pop(); 126 local _, timer, id = timers:pop();
127 local ok, ret = pcall(timer, now, id); 127 local ok, ret = xpcall(timer, traceback, now, id);
128 if ok and type(ret) == "number" then 128 if ok and type(ret) == "number" then
129 local next_time = elapsed+ret; 129 local next_time = elapsed+ret;
130 timers:insert(timer, next_time); 130 timers:insert(timer, next_time);
131 elseif not ok then 131 elseif not ok then
132 log("error", "Error in timer: %s", ret); 132 log("error", "Error in timer: %s", ret);