Skip to content

Commit

Permalink
Slightly better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Oct 21, 2012
1 parent 30804ae commit 99739e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Keter/App.hs
Expand Up @@ -90,7 +90,11 @@ unpackBundle tf bundle appname = do
let rest = do
unpackTar dir $ Tar.read $ decompress lbs
let configFP = dir F.</> "config" F.</> "keter.yaml"
Just config <- decodeFile $ F.encodeString configFP
mconfig <- decodeFile $ F.encodeString configFP
config <-
case mconfig of
Just config -> return config
Nothing -> throwIO InvalidConfigFile
return (dir, config
{ configStaticHosts = Set.fromList
$ mapMaybe (fixStaticHost dir)
Expand Down
1 change: 1 addition & 0 deletions Keter/Prelude.hs
Expand Up @@ -288,6 +288,7 @@ instance FromText Blaze.Builder where
data KeterException = CannotParsePostgres F.FilePath
| ExitCodeFailure F.FilePath ExitCode
| NoPortsAvailable
| InvalidConfigFile
deriving (P.Show, Typeable)
instance E.Exception KeterException

Expand Down
2 changes: 1 addition & 1 deletion Keter/Process.hs
Expand Up @@ -59,7 +59,7 @@ run exec dir args env logger = do
attach logger $ LogPipes pout perr
log $ ProcessCreated exec
return (Running pid, do
liftIO $ waitForProcess pid `onException` killProcess pid
_ <- liftIO $ waitForProcess pid `onException` killProcess pid
loop (Just now))
next
forkKIO $ loop Nothing
Expand Down

0 comments on commit 99739e3

Please sign in to comment.