on master help sign in
Use Build.Print to show errors
commitfc154f91cf3410ba664077be815c2dd4bbb499ea authorEvan Czaplicki <info@elm-lang.org> dateMon 20 Jan 2014, 14:01 (13 years ago) parent6ba394c
1 file changed+3−8
compiler/Build/Interface.hs+3−8
compiler/Build/Interface.hs+3−8
@@ -4,28 +4,23 @@ module Build.Interface (load,isValid) where
44import qualified Data.ByteString.Lazy as L
55import qualified Data.Binary as Binary
66
7+import qualified Build.Print as Print
78import qualified Elm.Internal.Version as Version
89import System.Directory (doesFileExist)
9−import System.Exit
10−import System.IO
11−
1210import SourceSyntax.Module
1311
1412load :: Binary.Binary a => FilePath -> IO a
1513load filePath =
1614 do exists <- doesFileExist filePath
1715 case exists of
18− False -> failure $ "Unable to find file " ++ filePath ++ " for deserialization!"
16+ False -> Print.failure $ "Unable to find file " ++ filePath ++ " for deserialization!"
1917 True -> do
2018 bytes <- L.readFile filePath
2119 case Binary.decodeOrFail bytes of
2220 Right (_, _, binaryInfo) -> return binaryInfo
23− Left (_, offset, err) -> failure $ msg offset err
21+ Left (_, offset, err) -> Print.failure $ msg offset err
2422
2523 where
26− failure err = do hPutStrLn stderr err
27− exitFailure
28−
2924 msg offset err = concat
3025 [ "Error reading build artifact: ", filePath, "\n"
3126 , " '", err, "' at offset ", show offset, "\n"