Closed emtenet closed 6 years ago
I have found an issue when the decoder of expectJson fails.
expectJson
A SCE (Short Correct Example) is at: https://gist.github.com/emtenet/88bb8b62689caad725314e510ef85972
It gives Json.Decode.Fail "FAIL" to Http.get. The problem with the example is you need to refer to a valid JSON file and need the appropriate cross-origin policies to be setup...
Json.Decode.Fail "FAIL"
Http.get
As far as I understand, the following line: https://github.com/elm/http/blob/beta-1.0.0/src/Elm/Kernel/Http.js#L108 is wrapping the decode failure as a BadPayload error but with a missing A2 produces a function rather than a Http.Error
BadPayload
A2
Http.Error
Thank you for the extremely helpful issue! Verified the fix locally!
I have found an issue when the decoder of
expectJson
fails.A SCE (Short Correct Example) is at: https://gist.github.com/emtenet/88bb8b62689caad725314e510ef85972
It gives
Json.Decode.Fail "FAIL"
toHttp.get
. The problem with the example is you need to refer to a valid JSON file and need the appropriate cross-origin policies to be setup...As far as I understand, the following line: https://github.com/elm/http/blob/beta-1.0.0/src/Elm/Kernel/Http.js#L108 is wrapping the decode failure as a
BadPayload
error but with a missingA2
produces a function rather than aHttp.Error