ignoring error.
This commit is contained in:
parent
0f08eb5e32
commit
e94cc84c43
5
Check.hs
5
Check.hs
@ -6,6 +6,7 @@ import Control.Monad
|
|||||||
import Data.IORef
|
import Data.IORef
|
||||||
import DynFlags
|
import DynFlags
|
||||||
import ErrUtils
|
import ErrUtils
|
||||||
|
import Exception
|
||||||
import FastString
|
import FastString
|
||||||
import GHC
|
import GHC
|
||||||
import GHC.Paths (libdir)
|
import GHC.Paths (libdir)
|
||||||
@ -32,7 +33,7 @@ cmdOptions :: [Located String]
|
|||||||
cmdOptions = map noLoc ["-Wall","-fno-warn-unused-do-bind"]
|
cmdOptions = map noLoc ["-Wall","-fno-warn-unused-do-bind"]
|
||||||
|
|
||||||
check :: String -> String -> IO [String]
|
check :: String -> String -> IO [String]
|
||||||
check fileName dir = defaultErrorHandler defaultDynFlags $ runGhc (Just libdir) $ do
|
check fileName dir = ghandle ignore $ runGhc (Just libdir) $ do
|
||||||
ref <- liftIO $ newIORef []
|
ref <- liftIO $ newIORef []
|
||||||
initSession
|
initSession
|
||||||
setTargetFile fileName
|
setTargetFile fileName
|
||||||
@ -46,6 +47,8 @@ check fileName dir = defaultErrorHandler defaultDynFlags $ runGhc (Just libdir)
|
|||||||
setTargetFile file = do
|
setTargetFile file = do
|
||||||
target <- guessTarget file Nothing
|
target <- guessTarget file Nothing
|
||||||
setTargets [target]
|
setTargets [target]
|
||||||
|
ignore :: SomeException -> IO [String]
|
||||||
|
ignore _ = return []
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user