Fix errors.

This commit is contained in:
Dillon Kearns 2022-12-29 14:14:08 -07:00
parent ac153f6494
commit 499390aeae
2 changed files with 17 additions and 4 deletions

View File

@ -407,8 +407,21 @@ requestRaw request__ expect =
) )
) )
|> toResult |> toResult
|> DataSource.mapError (\error -> Exception.Catchable error "TODO - error message here") |> DataSource.mapError
(\error ->
Exception.Catchable error (errorToString error)
) )
)
errorToString : Pages.StaticHttpRequest.Error -> String
errorToString error =
case error of
Pages.StaticHttpRequest.DecoderError string ->
string
Pages.StaticHttpRequest.UserCalledStaticHttpFail string ->
string
{-| -} {-| -}

View File

@ -305,11 +305,11 @@ all =
"toJsPort" "toJsPort"
(Codec.decoder (ToJsPayload.successCodecNew2 "" "")) (Codec.decoder (ToJsPayload.successCodecNew2 "" ""))
(expectErrorsPort (expectErrorsPort
"""-- CALLED STATIC HTTP FAIL ----------------------------------------------------- elm-pages """-- INTERNAL ERROR ----------------------------------------------------- elm-pages
I ran into a call to `DataSource.fail` with message: String was not uppercased""" String was not uppercased"""
) )
, test "POST method works" <| , test "POST method works" <|
\() -> \() ->
@ -392,7 +392,7 @@ I ran into a call to `DataSource.fail` with message: String was not uppercased""
"toJsPort" "toJsPort"
(Codec.decoder (ToJsPayload.successCodecNew2 "" "")) (Codec.decoder (ToJsPayload.successCodecNew2 "" ""))
(expectErrorsPort (expectErrorsPort
"""-- STATIC HTTP DECODING ERROR ----------------------------------------------------- elm-pages """-- INTERNAL ERROR ----------------------------------------------------- elm-pages
Problem with the given value: Problem with the given value: