better handling of lifting from XMPP -> Assistant

This commit is contained in:
Joey Hess 2012-11-05 19:39:08 -04:00
parent fdb6a88877
commit 8f08aa3f45
7 changed files with 81 additions and 88 deletions

View file

@ -19,12 +19,12 @@ runNamedThread (NamedThread name a) = do
liftIO . go $ d { threadName = name }
where
go d = do
r <- E.try (runAssistant a d) :: IO (Either E.SomeException ())
r <- E.try (runAssistant d a) :: IO (Either E.SomeException ())
case r of
Right _ -> noop
Left e -> do
let msg = unwords [name, "crashed:", show e]
hPutStrLn stderr msg
-- TODO click to restart
flip runAssistant d $ void $
runAssistant d $ void $
addAlert $ warningAlert name msg