Skip to content

Commit 54a7e52

Browse files
committed
D.S.Utils.topHandlerWith: wrap all error messages
Fixes #3157. The wrapText helper is used to format all error messages. Previously, it was only used to format IOException errors; other exceptions would be formatted incorrectly.
1 parent 8b4e339 commit 54a7e52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Cabal/Distribution/Simple/Utils.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ topHandlerWith cont prog =
268268
handle se = do
269269
hFlush stdout
270270
pname <- getProgName
271-
hPutStr stderr (message pname se)
271+
hPutStr stderr (wrapText (message pname se))
272272
cont se
273273

274274
message :: String -> Exception.SomeException -> String
@@ -282,7 +282,7 @@ topHandlerWith cont prog =
282282
l@(n:_) | Char.isDigit n -> ':' : l
283283
_ -> ""
284284
detail = ioeGetErrorString ioe
285-
in wrapText (pname ++ ": " ++ file ++ detail)
285+
in pname ++ ": " ++ file ++ detail
286286
Nothing ->
287287
#if __GLASGOW_HASKELL__ < 710
288288
show se

0 commit comments

Comments
 (0)