mirror of
https://github.com/penpot/penpot.git
synced 2025-02-20 22:06:07 -05:00
Minor changes on default error handling.
This commit is contained in:
parent
e103335cc1
commit
51f1ac54d9
1 changed files with 13 additions and 5 deletions
|
@ -90,11 +90,19 @@
|
||||||
|
|
||||||
(defn- on-error
|
(defn- on-error
|
||||||
"A default error handler."
|
"A default error handler."
|
||||||
[e]
|
[error]
|
||||||
|
(cond
|
||||||
|
(and (:status error)
|
||||||
|
(:payload error)
|
||||||
|
(= (:status error) 403))
|
||||||
|
(emit! (uxbox.data.auth/logout))
|
||||||
|
|
||||||
|
:else
|
||||||
|
(do
|
||||||
(uum/error (tr "errors.generic"))
|
(uum/error (tr "errors.generic"))
|
||||||
(println "Unexpected error: " e)
|
(println "Unexpected error: " error)
|
||||||
(js/console.log (.-stack e))
|
(js/console.log (.-stack error))
|
||||||
(rx/throw e))
|
(rx/throw error))))
|
||||||
|
|
||||||
(defn init
|
(defn init
|
||||||
"Initializes the stream event loop and
|
"Initializes the stream event loop and
|
||||||
|
|
Loading…
Add table
Reference in a new issue