mirror of
https://github.com/penpot/penpot.git
synced 2025-01-27 00:49:28 -05:00
✨ Improve connection errors handling on workspace save operation
This commit is contained in:
parent
9a60ac477f
commit
bec09fb5d1
3 changed files with 16 additions and 6 deletions
|
@ -182,11 +182,19 @@
|
|||
|
||||
(rx/of (shapes-changes-persisted-finished))))))
|
||||
(rx/catch (fn [cause]
|
||||
(rx/concat
|
||||
(if (= :authentication (:type cause))
|
||||
(rx/empty)
|
||||
(rx/of (rt/assign-exception cause)))
|
||||
(rx/throw cause)))))))))
|
||||
(cond
|
||||
(= :authentication (:type cause))
|
||||
(rx/throw cause)
|
||||
|
||||
(instance? js/TypeError cause)
|
||||
(->> (rx/timer 2000)
|
||||
(rx/map (fn [_]
|
||||
(persist-changes file-id file-revn changes pending-commits))))
|
||||
|
||||
:else
|
||||
(rx/concat
|
||||
(rx/of (rt/assign-exception cause))
|
||||
(rx/throw cause))))))))))
|
||||
|
||||
;; Event to be thrown after the changes have been persisted
|
||||
(defn shapes-changes-persisted-finished
|
||||
|
|
|
@ -66,7 +66,8 @@
|
|||
|
||||
(defmethod ptk/handle-error :default
|
||||
[error]
|
||||
(ts/schedule #(st/emit! (rt/assign-exception (::instance error))))
|
||||
(when-let [cause (::instance error)]
|
||||
(ts/schedule #(st/emit! (rt/assign-exception cause))))
|
||||
(print-group! "Unhandled Error"
|
||||
(fn []
|
||||
(print-trace! error)
|
||||
|
|
|
@ -142,6 +142,7 @@
|
|||
|
||||
(mf/with-effect [theme]
|
||||
(dom/set-html-theme-color theme))
|
||||
|
||||
[:& (mf/provider ctx/current-route) {:value route}
|
||||
[:& (mf/provider ctx/current-profile) {:value profile}
|
||||
(if edata
|
||||
|
|
Loading…
Add table
Reference in a new issue