diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-12-01 13:17:44 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-12-01 13:26:44 +0100 |
commit | 04861769d80fb0d30eb3141fb67f9082f4e7bcac (patch) | |
tree | c70c3047617db27ce59a72cc382af36aa80b6505 | |
parent | c6c5f094c41b0a024f052ce2350872490f60a73a (diff) |
feat: add original error message in error containers
-rw-r--r-- | src/frontend/tubo/layout/views.cljs | 10 | ||||
-rw-r--r-- | src/frontend/tubo/notifications/views.cljs | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/frontend/tubo/layout/views.cljs b/src/frontend/tubo/layout/views.cljs index 90dc3ef..d50c066 100644 --- a/src/frontend/tubo/layout/views.cljs +++ b/src/frontend/tubo/layout/views.cljs @@ -225,14 +225,14 @@ (defn error [{:keys [_failure parse-error status status-text]} cb] - [:div.flex.flex-auto.h-full.items-center.justify-center.p-5 - [:div.flex.flex-col.gap-y-6.border-border-neutral-300.rounded.dark:border-stone-700.bg-neutral-300.dark:bg-neutral-800.p-5 + [:div.flex.flex-auto.h-full.items-center.justify-center.p-8 + [:div.flex.flex-col.gap-y-8.border-border-neutral-300.rounded.dark:border-stone-700.bg-neutral-300.dark:bg-neutral-800.p-8 [:div.flex.items-center.gap-2.text-xl [:i.fa-solid.fa-circle-exclamation] [:h3.font-bold - (str status (when (and status status-text) ": ") status-text)]] + (str status " " status-text)]] (when parse-error - [:span (:status-text parse-error)]) - [:div.flex.justify-center.gap-x-3 + [:span (or (:original-text parse-error) (:status-text parse-error))]) + [:div.flex.justify-center.gap-x-6 [primary-button "Go Back" #(rf/dispatch [:navigation/history-go -1])] [secondary-button "Retry" #(rf/dispatch cb)]]]]) diff --git a/src/frontend/tubo/notifications/views.cljs b/src/frontend/tubo/notifications/views.cljs index 7d0ba98..66095a6 100644 --- a/src/frontend/tubo/notifications/views.cljs +++ b/src/frontend/tubo/notifications/views.cljs @@ -22,9 +22,10 @@ #(rf/dispatch [:notifications/remove (:id notification)])} [:i.fa-solid.fa-close]] [:span.font-bold - (str status (when (and status status-text) ": ") status-text)] + (str status " " status-text)] (when parse-error - [:span.line-clamp-1 (:status-text parse-error)])]]])) + [:span.line-clamp-1 + (or (:original-text parse-error) (:status-text parse-error))])]]])) (defn notifications-panel [] |