Permalink
Browse files

Slightly better error message

  • Loading branch information...
1 parent 30804ae commit 99739e3f84b8d1262e210c38cd4c5310a98f74d5 @snoyberg committed Oct 21, 2012
Showing with 7 additions and 2 deletions.
  1. +5 −1 Keter/App.hs
  2. +1 −0 Keter/Prelude.hs
  3. +1 −1 Keter/Process.hs
View
@@ -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
@@ -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
@@ -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

0 comments on commit 99739e3

Please sign in to comment.