@@ -107,7 +107,7 @@ import Data.Aeson.Types ( Value(..), Parser
107 , defaultOptions
107 , defaultOptions
108 , defaultTaggedObject
108 , defaultTaggedObject
110−import Data.Aeson.Types.Internal (Encoding(..))
110+import Data.Aeson.Types.Internal (Encoding(..), (<?>), JSONPathElement(Key))
111import Control.Monad ( liftM2, return, mapM, fail )
111import Control.Monad ( liftM2, return, mapM, fail )
112import Data.Bool ( Bool(False, True), otherwise, (&&), not )
112import Data.Bool ( Bool(False, True), otherwise, (&&), not )
113import Data.Either ( Either(Left, Right) )
113import Data.Either ( Either(Left, Right) )
@@ -1010,7 +1010,7 @@ instance OVERLAPPABLE_ (FromJSON a) => LookupField a where
1010 lookupField tName rec obj key =
1010 lookupField tName rec obj key =
1011 case H.lookup key obj of
1011 case H.lookup key obj of
1012 Nothing -> unknownFieldFail tName rec (T.unpack key)
1012 Nothing -> unknownFieldFail tName rec (T.unpack key)
1013− Just v -> parseJSON v
1013+ Just v -> parseJSON v <?> Key key
1015instance (FromJSON a) => LookupField (Maybe a) where
1015instance (FromJSON a) => LookupField (Maybe a) where
1016 lookupField _ _ = (.:?)
1016 lookupField _ _ = (.:?)