From e0dde88797a42236c150096e4de1dfc263a30f1a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 1 May 2023 12:25:14 -0400 Subject: [PATCH] fix reversion in display of fatal exceptions fdac66ae10a7022326d1470862c93fd191216e61 lost the "git-annex:" prefix, which broke datalad's parsing of an error message (ugh) Also, don't use warningIO because it displays a blank line to stdout, which is also a behavior change from before, and does not seem necessary. Sponsored-by: Brock Spratlen on Patreon --- Messages.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Messages.hs b/Messages.hs index feb2fe4993..2fdfffc863 100644 --- a/Messages.hs +++ b/Messages.hs @@ -60,6 +60,7 @@ import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as S8 import System.Exit import qualified Control.Monad.Catch as M +import Data.String import Common import Types @@ -200,8 +201,8 @@ endResult :: Bool -> S.ByteString endResult True = "ok" endResult False = "failed" -toplevelMsg :: StringContainingQuotedPath -> StringContainingQuotedPath -toplevelMsg = ("git-annex: " <>) +toplevelMsg :: (Semigroup t, IsString t) => t -> t +toplevelMsg s = fromString "git-annex: " <> s toplevelFileProblem :: Bool -> MessageId -> StringContainingQuotedPath -> String -> RawFilePath -> Maybe Key -> SeekInput -> Annex () toplevelFileProblem makeway messageid msg action file mkey si = do @@ -353,5 +354,5 @@ sanitizeTopLevelExceptionMessages a = a `catches` ((M.Handler (\ (e :: ExitCode) -> throwM e)) : nonAsyncHandler go) where go e = do - warningIO (show e) + hPutStrLn stderr $ safeOutput $ toplevelMsg (show e) exitWith $ ExitFailure 1 -- 2.30.2