on master help sign in
update error message with ',' ending, add back prependFailure
commit805d5605b349501d4792144c5c64ca39176eeb24 authorgrdvnl <grdvnl@gmail.com> dateMon 14 Oct 2019, 05:41 (7 years ago) parentf5e5073
1 file changed+3−2
Data/Aeson/Types/FromJSON.hs+3−2
Data/Aeson/Types/FromJSON.hs+3−2
@@ -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