Closed kuribas closed 2 years ago
any update?
This would be nice to have.
Thanks @kuribas , for the PR! Could you rebase it on latest master so that CI can run on it? Would it be possible to add a test demonstrating the new behavior in a reproducible way?
Error messages in genericParseNamedRecord don't mention in which field the error occurs:
λ> data Person = Person { name :: !String , salary :: !Int } deriving (Generic, Show) λ> instance ToNamedRecord Person λ> instance FromNamedRecord Person λ> (runParser $ parseNamedRecord $ fromList [("name","Kristof"),("salary","foobar"),("foo", "32")]) :: Either String Person Left "expected Int, got \"foobar\" (Failed reading: takeWhile1)"
This pull request changes the error message to:
Left "in named field \"salary\": expected Int, got \"foobar\" (Failed reading: takeWhile1)"