Slightly better error message

This commit is contained in:
Michael Snoyman 2012-10-21 06:48:34 +02:00
parent 30804ae341
commit 99739e3f84
3 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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

View File

@ -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