Skip to content

Commit f050d49

Browse files
committed
Fix a warning
This didn't show up in harendra-kumar:stack-init, because I enabled more warnings after the base of that branch.
1 parent 5b9b1ed commit f050d49

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/Stack/Solver.hs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,18 @@ cabalSolver menv cabalfps constraintType
104104
fmap toFilePath cabalfps
105105

106106
catch (liftM Just (readProcessStdout (Just tmpdir) menv "cabal" args))
107-
(\e@(ReadProcessException _ _ _ err) -> do
108-
let errMsg = decodeUtf8With lenientDecode err
109-
if LT.isInfixOf "Could not resolve dependencies" errMsg
110-
then do
111-
$logInfo "Attempt failed."
112-
$logInfo "\n>>>> Cabal errors begin"
113-
$logInfo $ LT.toStrict errMsg
114-
<> "<<<< Cabal errors end\n"
115-
return Nothing
116-
else throwM e)
107+
(\ex -> case ex of
108+
ReadProcessException _ _ _ err -> do
109+
let errMsg = decodeUtf8With lenientDecode err
110+
if LT.isInfixOf "Could not resolve dependencies" errMsg
111+
then do
112+
$logInfo "Attempt failed."
113+
$logInfo "\n>>>> Cabal errors begin"
114+
$logInfo $ LT.toStrict errMsg
115+
<> "<<<< Cabal errors end\n"
116+
return Nothing
117+
else throwM ex
118+
_ -> throwM ex)
117119
>>= maybe (return Nothing) parseCabalOutput
118120

119121
where

0 commit comments

Comments
 (0)