Catch exceptions during reload #64

This commit is contained in:
Michael Snoyman 2014-12-18 08:06:58 +02:00
parent b281850a74
commit 308deed377
3 changed files with 18 additions and 9 deletions

View File

@ -1,3 +1,7 @@
## 1.3.7.1
Bug fix: catch exceptions during reload [#64](https://github.com/snoyberg/keter/issues/64)
## 1.3.7
* Add ability to use middleware [#63](https://github.com/snoyberg/keter/pulls/63)

View File

@ -222,18 +222,23 @@ launchWorker AppManager {..} appid tstate tmnext mcurrentApp0 action0 = void $ f
eres <- E.try $ App.start appStartConfig appid input
case eres of
Left e -> do
let name =
case appid of
AIBuiltin -> "<builtin>"
AINamed x -> x
log $ ErrorStartingBundle name e
return Nothing
Right app -> return $ Just app
processAction (Just app) (Reload input) = do
App.reload app input
-- reloading will /always/ result in a valid app, either the old one
-- will continue running or the new one will replace it.
return $ Just app
eres <- E.try $ App.reload app input
case eres of
Left e -> do
log $ ErrorStartingBundle name e
-- reloading will /always/ result in a valid app, either the old one
-- will continue running or the new one will replace it.
return (Just app)
Right () -> return $ Just app
name =
case appid of
AIBuiltin -> "<builtin>"
AINamed x -> x
addApp :: AppManager -> FilePath -> IO ()
addApp appMan bundle = do

View File

@ -1,5 +1,5 @@
Name: keter
Version: 1.3.7
Version: 1.3.7.1
Synopsis: Web application deployment manager, focusing on Haskell web frameworks
Description: Hackage documentation generation is not reliable. For up to date documentation, please see: <http://www.stackage.org/package/keter>.
Homepage: http://www.yesodweb.com/