Closed kika closed 5 years ago
@kika this is absolutely a valuable thing to add! Chris Cornwell merged some code that serves the same purpose recently (https://github.com/purescript-contrib/purescript-argonaut-codecs/pull/44) but there is still the opportunity to do more.
I know this is a very late response, but please do feel free to add better error reporting. I've joined the contrib organization specifically to stay on top of things like this and make sure your issues / PRs are promptly addressed. If you open a PR with this functionality then I will be sure to respond within a day or two.
I will leave this issue open for a few days in case you'd like to continue the conversation, and then I'll close it.
The majority of decoders in 'Data.Argonaut.Decode' complain about errors without providing context for the error. For example
Couldn't decode StrMap: Value is not a String
. When parsing a large JSON blob with a lot of different structures in it, it's quite hard to figure out what exactly is the problem. Some decoders though, do provide at least the value which triggered the error: https://github.com/purescript-contrib/purescript-argonaut-codecs/blob/fa2cbbbc553033761e522d22d5e07904a830ab5b/src/Data/Argonaut/Decode/Class.purs#L68I can submit a PR doing the same for the rest of the decoders.