Keep error information in extract
This commit is contained in:
parent
7a6e37c57a
commit
aeb11fb0b5
@ -22,10 +22,12 @@ isolateCradle action =
|
|||||||
where
|
where
|
||||||
modifyEnv e = e { gmCradle = (gmCradle e) { cradlePkgDbStack = [GlobalDb] } }
|
modifyEnv e = e { gmCradle = (gmCradle e) { cradlePkgDbStack = [GlobalDb] } }
|
||||||
|
|
||||||
extract :: IO (Either e a, w) -> IO a
|
extract :: Show e => IO (Either e a, w) -> IO a
|
||||||
extract action = do
|
extract action = do
|
||||||
(Right a, _) <- action
|
(r,_) <- action
|
||||||
return a
|
case r of
|
||||||
|
Right a -> return a
|
||||||
|
Left e -> error $ show e
|
||||||
|
|
||||||
runIsolatedGhcMod :: Options -> GhcModT IO a -> IO a
|
runIsolatedGhcMod :: Options -> GhcModT IO a -> IO a
|
||||||
runIsolatedGhcMod opt action = do
|
runIsolatedGhcMod opt action = do
|
||||||
|
Loading…
Reference in New Issue
Block a user