Show errors from failed register request

Also include a `@` in the valid chars for "idents". This allows to use
an e-mail address as username.
This commit is contained in:
Eike Kettner
2021-03-10 22:14:55 +01:00
parent 70b5625c48
commit a4a84abae5
3 changed files with 20 additions and 8 deletions

View File

@ -164,12 +164,14 @@ errorToString : Http.Error -> String
errorToString error =
let
f sc =
case sc of
404 ->
"The requested resource doesn't exist."
if sc == 404 then
"The requested resource doesn't exist."
_ ->
"There was an invalid response status: " ++ String.fromInt sc
else if sc >= 400 && sc < 500 then
"Invalid input when processing the request."
else
"There was an invalid response status: " ++ String.fromInt sc ++ "."
in
errorToStringStatus error f