Fix error presentation

This commit is contained in:
Daniel Gröber 2014-08-13 18:26:30 +02:00
parent 4fcef0cb2b
commit f2ccea7f29
1 changed files with 2 additions and 1 deletions

View File

@ -138,7 +138,8 @@ main = flip E.catches handlers $ do
cmd -> E.throw (NoSuchCommand cmd)
case res of
Right s -> putStr s
Left e -> error $ show e
Left (GMENoMsg) -> hPutStrLn stderr "Unknown error"
Left (GMEString msg) -> hPutStrLn stderr msg
where
handlers = [Handler (handleThenExit handler1), Handler (handleThenExit handler2)]
handleThenExit handler e = handler e >> exitFailure