Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upJson.Decode.customDecoder swallows Err strings #637
Comments
added a commit
to noahzgordon/core
that referenced
this issue
Jun 3, 2016
noahzgordon
referenced this issue
Jun 3, 2016
Closed
Fixes #637; Preserve Err values when using Json.Decode.customDecoder #639
referenced
this issue
Jul 15, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
Should be fixed by in 7f6e518 |
evancz
closed this
Jul 15, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
noahzgordon commentedJun 3, 2016
The function
Json.Decode.customDecoderhas the following type:Decoder a -> (a -> Result String b) -> Decoder bMy expectation as a user is that the decoder produced by
customDecoderdecodes an initial payload using the first argument, then maps the result into the second argument. However, when the second argument is applied and its result resolves to anErr string, thestringis discarded. No matter what, when a custom decoder fails, the string value of Err is "Expecting something custom but instead got: ".You can reproduce this by entering the following into elm repl: