halfzebra / elm-examples

:book: Practical examples in Elm
210 stars 22 forks source link

Improve http-get example #3

Closed halfzebra closed 7 years ago

halfzebra commented 8 years ago

Currently this example silently fails with an error being displayed in dev-tool console.

I think the example should feature some error handling, e.g. we can pattern match through Http.Error and notify the user with a readable message.

httpErrorToString : Error -> String
httpErrorToString err =
    case err of
        Timeout ->
            "The request took too long"
        -- And etc.