# HG changeset patch # User Matthew Wild # Date 1376418180 -3600 # Node ID 66c3ad5d29ad9c5aea4a9b7f495e9fc2e3c45cf8 # Parent e8c79796ead981ee0ecb173a4c22e144cc19688d util.async: Fix logic bug that prevented error watcher being called for runners diff -r e8c79796ead9 -r 66c3ad5d29ad util/async.lua --- a/util/async.lua Mon Aug 12 13:22:27 2013 +0200 +++ b/util/async.lua Tue Aug 13 19:23:00 2013 +0100 @@ -103,8 +103,12 @@ 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