Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error message on wrong expectation #486

Open
miniBill opened this issue Jul 23, 2024 · 2 comments
Open

Unclear error message on wrong expectation #486

miniBill opened this issue Jul 23, 2024 · 2 comments

Comments

@miniBill
Copy link
Contributor

miniBill commented Jul 23, 2024

-- HTTP ERROR ---------------
BadBody: Unexpected combination, internal error

This is what happens when you get a non-json response but you expected a json one. The error message is less than maximally helpful.

@dillonkearns
Copy link
Owner

Thanks for the issue! Do you have the relevant code snippet that causes this?

@miniBill
Copy link
Contributor Author

module ExpectingJson exposing (run)

import BackendTask exposing (BackendTask)
import BackendTask.Http as Http
import FatalError exposing (FatalError)
import Json.Decode
import Pages.Script as Script exposing (Script)


run : Script
run =
    Script.withoutCliOptions task


task : BackendTask FatalError ()
task =
    Http.getJson "http://www.viaggiatreno.it/viaggiatrenonew/resteasy/viaggiatreno/autocompletaStazione/LAT" Json.Decode.value
        |> BackendTask.allowFatal
        |> BackendTask.map (\_ -> ())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants