on master help sign in
update error message from 'associated' to 'containing'
commita46d7834607dacf9088bbea3ee9bebee7e6e5933 authorgrdvnl <grdvnl@gmail.com> dateTue 15 Oct 2019, 21:19 (7 years ago) parent7e95e8d
2 files changed+2−2
Data/Aeson/Types/FromJSON.hs+1−1 tests/golden/generic.expected+1−1
Data/Aeson/Types/FromJSON.hs+1−1
@@ -959,7 +959,7 @@ contextType = prependContext
959959contextTag :: Text -> [String] -> Parser a -> Parser a
960960contextTag tagKey cnames = prependFailure
961961 ("expected Object with key \"" ++ unpack tagKey ++ "\"" ++
962− " associated to one of " ++ show cnames ++ ", ")
962+ " containing to one of " ++ show cnames ++ ", ")
963963
964964-- | Add the name of the constructor being parsed to a parser's error messages.
965965contextCons :: ConName -> TypeName -> Parser a -> Parser a
tests/golden/generic.expected+1−1
@@ -10,7 +10,7 @@ Error in $: parsing Types.SomeType(Unary) failed, key "contents" not found
1010Error in $: parsing Types.SomeType(Record) failed, key "testone" not found
1111Error in $.testone: parsing Double failed, unexpected Boolean
1212Error in $.tag: parsing Types.SomeType failed, expected tag field to be one of ["nullary","unary","product","record","list"], but found tag "X"
13−Error in $: parsing Types.SomeType failed, expected Object with key "tag" associated to one of ["nullary","unary","product","record","list"], key "tag" not found
13+Error in $: parsing Types.SomeType failed, expected Object with key "tag" containing to one of ["nullary","unary","product","record","list"], key "tag" not found
1414Error in $: parsing Types.SomeType failed, expected Object, but encountered Array
1515SomeType (single-field)
1616Error in $.unary: parsing Int failed, expected Number, but encountered Object