fix reversion in display of fatal exceptions
fdac66ae10
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
This commit is contained in:
parent
0bf983d3ab
commit
e0dde88797
1 changed files with 4 additions and 3 deletions
|
@ -60,6 +60,7 @@ import qualified Data.ByteString as S
|
||||||
import qualified Data.ByteString.Char8 as S8
|
import qualified Data.ByteString.Char8 as S8
|
||||||
import System.Exit
|
import System.Exit
|
||||||
import qualified Control.Monad.Catch as M
|
import qualified Control.Monad.Catch as M
|
||||||
|
import Data.String
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
import Types
|
import Types
|
||||||
|
@ -200,8 +201,8 @@ endResult :: Bool -> S.ByteString
|
||||||
endResult True = "ok"
|
endResult True = "ok"
|
||||||
endResult False = "failed"
|
endResult False = "failed"
|
||||||
|
|
||||||
toplevelMsg :: StringContainingQuotedPath -> StringContainingQuotedPath
|
toplevelMsg :: (Semigroup t, IsString t) => t -> t
|
||||||
toplevelMsg = ("git-annex: " <>)
|
toplevelMsg s = fromString "git-annex: " <> s
|
||||||
|
|
||||||
toplevelFileProblem :: Bool -> MessageId -> StringContainingQuotedPath -> String -> RawFilePath -> Maybe Key -> SeekInput -> Annex ()
|
toplevelFileProblem :: Bool -> MessageId -> StringContainingQuotedPath -> String -> RawFilePath -> Maybe Key -> SeekInput -> Annex ()
|
||||||
toplevelFileProblem makeway messageid msg action file mkey si = do
|
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)
|
((M.Handler (\ (e :: ExitCode) -> throwM e)) : nonAsyncHandler go)
|
||||||
where
|
where
|
||||||
go e = do
|
go e = do
|
||||||
warningIO (show e)
|
hPutStrLn stderr $ safeOutput $ toplevelMsg (show e)
|
||||||
exitWith $ ExitFailure 1
|
exitWith $ ExitFailure 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue