split msg into lines

msg is what would be output to stderr, so has some layout and
formatting, which is perhaps not ideal, but let's at least avoid it
containing line breaks.
This commit is contained in:
Joey Hess 2018-02-19 15:55:00 -04:00
parent 572754c925
commit ff134618f0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -62,7 +62,7 @@ outputJSON jsonbuilder s = case outputType s of
outputError :: String -> Annex ()
outputError msg = withMessageState $ \s -> case (outputType s, jsonBuffer s) of
(JSONOutput jsonoptions, Just jb) | jsonErrorMessages jsonoptions ->
let jb' = Just (JSON.addErrorMessage [msg] jb)
let jb' = Just (JSON.addErrorMessage (lines msg) jb)
in Annex.changeState $ \st ->
st { Annex.output = s { jsonBuffer = jb' } }
_