Merge pull request #329 from DanielG/dev-error

Remove `withErrorHandler`, use `liftExceptions` instead
This commit is contained in:
Kazu Yamamoto
2014-08-19 11:41:44 +09:00
7 changed files with 33 additions and 26 deletions

View File

@@ -10,9 +10,9 @@ import Language.Haskell.GhcMod.DynFlags
import qualified Language.Haskell.GhcMod.Gap as Gap
import qualified GHC as G
import Language.Haskell.GhcMod.Logger
import Language.Haskell.GhcMod.Monad (IOish, GhcModT, withErrorHandler
, overrideGhcUserOptions)
import Language.Haskell.GhcMod.Monad (IOish, GhcModT, overrideGhcUserOptions)
import Language.Haskell.GhcMod.Target (setTargetFiles)
import Language.Haskell.GhcMod.Utils (liftExceptions)
----------------------------------------------------------------
@@ -22,7 +22,7 @@ checkSyntax :: IOish m
=> [FilePath] -- ^ The target files.
-> GhcModT m String
checkSyntax [] = return ""
checkSyntax files = withErrorHandler $ either id id <$> check files
checkSyntax files = liftExceptions $ either id id <$> check files
----------------------------------------------------------------
@@ -43,7 +43,7 @@ expandTemplate :: IOish m
=> [FilePath] -- ^ The target files.
-> GhcModT m String
expandTemplate [] = return ""
expandTemplate files = withErrorHandler $ either id id <$> expand files
expandTemplate files = liftExceptions $ either id id <$> expand files
----------------------------------------------------------------