You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, folks!
We have our Elm app where the server sends to us some objects with validation errors in them with BadStatus.
Previously we handled response body from BadStatus Http.Error. But after contract change in elm/http (previously evancz/elm-http), we can't figure out how to get it correctly.
P.S. We're using Http.task, so seems we can't add there expect field to get additional info, cause it exists only on Http.request
The text was updated successfully, but these errors were encountered:
@AntonLebiodkin there's some explanation here. You can replace Http.Error with your own custom error type and in the BadStatus case attempt to run a decoder on the body to get the validation errors.
There's no issue of creating your own version of Http.Error and extend the handling of missing 400 - body responses.
The problem is with usage of third party packages like RemoteData. Those packages import Http.Error directly and are not aware about the custom handlers you've created. This force you to copy paste a lot of type declarations.
Hi, folks!
We have our Elm app where the server sends to us some objects with validation errors in them with BadStatus.
Previously we handled response body from BadStatus Http.Error. But after contract change in elm/http (previously evancz/elm-http), we can't figure out how to get it correctly.
P.S. We're using Http.task, so seems we can't add there
expect
field to get additional info, cause it exists only on Http.requestThe text was updated successfully, but these errors were encountered: