projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41e9a59
)
util.async: Fix logic bug that prevented error watcher being called for runners
author
Matthew Wild
<mwild1@gmail.com>
Tue, 13 Aug 2013 18:23:00 +0000
(19:23 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Tue, 13 Aug 2013 18:23:00 +0000
(19:23 +0100)
util/async.lua
patch
|
blob
|
history
diff --git
a/util/async.lua
b/util/async.lua
index d0bc6c3d6f5fe8c849f9e254cc10691562aae726..8af8730f891d0b7ee648e96c7b477f9818a6e9fd 100644
(file)
--- a/
util/async.lua
+++ b/
util/async.lua
@@
-103,8
+103,12
@@
function runner_mt:run(input)
n = #q;
end
self.state = state;
- if state ~= self.notified_state then
- self.notified_state = state;
+ if err or state ~= self.notified_state then
+ if err then
+ state = "error"
+ else
+ self.notified_state = state;
+ end
local handler = self.watchers[state];
if handler then handler(self, err); end
end