Externalize error messages

This commit is contained in:
Eike Kettner
2021-04-17 11:14:29 +02:00
parent c9b54e80b7
commit b2cffb22ef
65 changed files with 1518 additions and 683 deletions

View File

@@ -23,7 +23,6 @@ import Html.Events exposing (onSubmit)
import Http
import Messages.Comp.UserManage exposing (Texts)
import Styles as S
import Util.Http
import Util.Maybe
@@ -45,6 +44,7 @@ type ViewMode
type FormError
= FormErrorNone
| FormErrorSubmit String
| FormErrorHttp Http.Error
| FormErrorInvalid
@@ -183,7 +183,7 @@ update flags msg model =
SubmitResp (Err err) ->
( { model
| formError = FormErrorSubmit (Util.Http.errorToString err)
| formError = FormErrorHttp err
, loading = False
}
, Cmd.none
@@ -319,6 +319,9 @@ viewForm2 texts settings model =
FormErrorSubmit err ->
text err
FormErrorHttp err ->
text (texts.httpError err)
FormErrorInvalid ->
text texts.pleaseCorrectErrors
]