From 77afb51613df5777582627e8c505fde57b0be188 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Mon, 25 Sep 2017 11:10:25 +0200 Subject: Add support for running Cabal's Setup.hs directly cabal-install 1.24 broke installing older Cabal versions which use build-type:custom. See https://github.com/haskell/cabal/pull/4787. This still breaks with HEAD on GHC<8. See https://github.com/haskell/cabal/pull/4786. --- CabalHelper/Compiletime/Log.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'CabalHelper/Compiletime/Log.hs') diff --git a/CabalHelper/Compiletime/Log.hs b/CabalHelper/Compiletime/Log.hs index 6931fa9..ec38f88 100644 --- a/CabalHelper/Compiletime/Log.hs +++ b/CabalHelper/Compiletime/Log.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE ScopedTypeVariables #-} + module CabalHelper.Compiletime.Log where import Control.Monad @@ -14,8 +16,8 @@ vLog Options { verbose = True } msg = liftIO $ hPutStrLn stderr msg vLog _ _ = return () -logSomeError :: Options -> String -> IO (Maybe a) -> IO (Maybe a) -logSomeError opts label a = do - a `E.catch` \se@(SomeException _) -> do - vLog opts $ label ++ ": " ++ show se +logIOError :: Options -> String -> IO (Maybe a) -> IO (Maybe a) +logIOError opts label a = do + a `E.catch` \(ex :: IOError) -> do + vLog opts $ label ++ ": " ++ E.displayException ex return Nothing -- cgit v1.2.3