git.iko.soy/typeable/cabal2nix
on master help sign in
Better error reporting in case of IO errors
commit0a35af1b379ee59d2913fa58d72982d234014664 authorBenno Fünfstück <benno.fuenfstueck@gmail.com> dateMon 26 Jan 2015, 21:49 (12 years ago) parentca341aa
1 file changed+1−1
src/Cabal2Nix/Package.hs+1−1
src/Cabal2Nix/Package.hs+1−1
@@ -131,7 +131,7 @@ cabalFromFile failHard file =
131131 -- that do not represent valid characters. To catch that exception, we need to
132132 -- wrap the whole block in `catchIO`, because of lazy IO. The `case` will force
133133 -- the reading of the file, so we will always catch the expression here.
134− MaybeT $ handleIO (const $ return Nothing) $ do
134+ MaybeT $ handleIO (\err -> Nothing <$ hPutStrLn stderr ("*** parsing cabal file: " ++ show err)) $ do
135135 content <- readFile file
136136 case Cabal.parsePackageDescription content of
137137 Cabal.ParseFailed e | failHard -> do