mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Externalize error messages
This commit is contained in:
@ -17,7 +17,6 @@ import Html.Attributes exposing (..)
|
||||
import Http
|
||||
import Messages.Comp.AttachmentMeta exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Http
|
||||
|
||||
|
||||
type alias Model =
|
||||
@ -29,7 +28,7 @@ type alias Model =
|
||||
type DataResult a
|
||||
= NotAvailable
|
||||
| Success a
|
||||
| Failure String
|
||||
| HttpFailure Http.Error
|
||||
|
||||
|
||||
emptyModel : Model
|
||||
@ -57,7 +56,7 @@ update msg model =
|
||||
{ model | meta = Success am }
|
||||
|
||||
MetaResp (Err err) ->
|
||||
{ model | meta = Failure (Util.Http.errorToString err) }
|
||||
{ model | meta = HttpFailure err }
|
||||
|
||||
|
||||
|
||||
@ -77,9 +76,9 @@ view2 texts attrs model =
|
||||
, label = texts.basics.loading
|
||||
}
|
||||
|
||||
Failure msg ->
|
||||
HttpFailure err ->
|
||||
div [ class S.errorMessage ]
|
||||
[ text msg
|
||||
[ text (texts.httpError err)
|
||||
]
|
||||
|
||||
Success data ->
|
||||
|
Reference in New Issue
Block a user