mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-10-22 13:20:12 +00:00
Externalize error messages
This commit is contained in:
@@ -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
|
||||
]
|
||||
|
Reference in New Issue
Block a user