Revert "--json-exceptions"

This reverts commit a325524454.

Turns out this was predicated on an incorrect belief that json output
didn't already sometimes lack the "key" field. Since json output already
can when `giveup` was used, it seems unncessary to add a whole new
option for this.
This commit is contained in:
Joey Hess 2023-04-25 17:37:34 -04:00
parent 7c514d717b
commit 91ba0cc7fd
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
33 changed files with 115 additions and 304 deletions

View file

@ -1,6 +1,6 @@
{- git-annex command-line JSON output and input
-
- Copyright 2011-2023 Joey Hess <id@joeyh.name>
- Copyright 2011-2021 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
@ -27,7 +27,6 @@ module Messages.JSON (
ObjectMap(..),
JSONActionItem(..),
AddJSONActionItemFields(..),
exceptionObject,
) where
import Control.Applicative
@ -219,14 +218,3 @@ newtype AddJSONActionItemFields a = AddJSONActionItemFields a
instance ToJSON' a => ToJSON' (AddJSONActionItemFields a) where
toJSON' (AddJSONActionItemFields a) = object [ ("fields", toJSON' a) ]
exceptionObject :: String -> String -> Maybe RawFilePath -> Object
exceptionObject eid msg mfile = case o of
Object o' -> o'
_ -> error "internal"
where
o = object
[ "exception" .= toJSON' eid
, "message" .= toJSON' msg
, "file" .= toJSON' (maybe "" decodeBS mfile)
]