Fix error presentation
This commit is contained in:
parent
4fcef0cb2b
commit
f2ccea7f29
@ -138,7 +138,8 @@ main = flip E.catches handlers $ do
|
|||||||
cmd -> E.throw (NoSuchCommand cmd)
|
cmd -> E.throw (NoSuchCommand cmd)
|
||||||
case res of
|
case res of
|
||||||
Right s -> putStr s
|
Right s -> putStr s
|
||||||
Left e -> error $ show e
|
Left (GMENoMsg) -> hPutStrLn stderr "Unknown error"
|
||||||
|
Left (GMEString msg) -> hPutStrLn stderr msg
|
||||||
where
|
where
|
||||||
handlers = [Handler (handleThenExit handler1), Handler (handleThenExit handler2)]
|
handlers = [Handler (handleThenExit handler1), Handler (handleThenExit handler2)]
|
||||||
handleThenExit handler e = handler e >> exitFailure
|
handleThenExit handler e = handler e >> exitFailure
|
||||||
|
Loading…
Reference in New Issue
Block a user