mirror of
https://github.com/penpot/penpot.git
synced 2025-06-15 06:11:39 +02:00
🎉 Add basic error handling to exporter app.
This commit is contained in:
parent
20c4b46930
commit
a1f0625bec
7 changed files with 107 additions and 26 deletions
|
@ -14,6 +14,7 @@
|
|||
[cuerdas.core :as str]
|
||||
[rumext.alpha :as mf]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.main.data.messages :as dm]
|
||||
[uxbox.main.data.workspace :as udw]
|
||||
[uxbox.main.refs :as refs]
|
||||
[uxbox.main.store :as st]
|
||||
|
@ -67,8 +68,10 @@
|
|||
(swap! loading? not)
|
||||
(->> (request-screenshot (:id page) (:id shape))
|
||||
(rx/subs
|
||||
(fn [{:keys [status body]}]
|
||||
(trigger-download (:name shape) body))
|
||||
(fn [{:keys [status body] :as response}]
|
||||
(if (= status 200)
|
||||
(trigger-download (:name shape) body)
|
||||
(st/emit! (dm/error (tr "errors.unexpected-error")))))
|
||||
(constantly nil)
|
||||
(fn []
|
||||
(swap! loading? not)))))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue