From 7a082cb3938619202436656daf96fbeb18a50c22 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 13 Aug 2013 19:23:00 +0100 Subject: util.async: Fix logic bug that prevented error watcher being called for runners --- util/async.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'util/async.lua') diff --git a/util/async.lua b/util/async.lua index d0bc6c3d..8af8730f 100644 --- 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 -- cgit v1.2.3