@@ -25,6 +25,7 @@
2525
2626module Data.Aeson.Types.FromJSON
2727 (
28+
2829 -- * Core JSON classes
2930 FromJSON(..)
3031 -- * Liftings to unary and binary type constructors
@@ -958,9 +959,9 @@ contextType = prependContext
958959-- | "contents", where "tag" i-- |s associated to one of ["Foo", "Bar"],
959960-- | The parser returned error was: could not find key "tag"
960961contextTag :: Text -> [String] -> Parser a -> Parser a
961−contextTag tagKey cnames = modifyFailure (const
962+contextTag tagKey cnames = prependFailure
962963 ("expected Object with key \"" ++ unpack tagKey ++ "\"" ++
963− " associated to one of " ++ show cnames ++ "."))
964+ " associated to one of " ++ show cnames ++ ", ")
964965
965966-- | Add the name of the constructor being parsed to a parser's error messages.
966967contextCons :: ConName -> TypeName -> Parser a -> Parser a