about summary refs log tree commit diff
path: root/client/src/Common.elm
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/Common.elm')
-rw-r--r--client/src/Common.elm27
1 files changed, 27 insertions, 0 deletions
diff --git a/client/src/Common.elm b/client/src/Common.elm
new file mode 100644
index 000000000000..a3106114d43a
--- /dev/null
+++ b/client/src/Common.elm
@@ -0,0 +1,27 @@
+module Common exposing (..)
+
+import Html exposing (..)
+import Maybe.Extra as ME
+import State
+import UI
+import Utils
+
+
+allErrors : State.Model -> Html State.Msg
+allErrors model =
+    div []
+        (State.allErrors
+            model
+            |> List.map
+                (\( mError, title ) ->
+                    case mError of
+                        Nothing ->
+                            text ""
+
+                        Just err ->
+                            UI.errorBanner
+                                { title = title
+                                , body = Utils.explainHttpError err
+                                }
+                )
+        )