mirror of
https://github.com/penpot/penpot.git
synced 2025-02-15 11:38:24 -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
|
||||
"A default error handler."
|
||||
[e]
|
||||
(uum/error (tr "errors.generic"))
|
||||
(println "Unexpected error: " e)
|
||||
(js/console.log (.-stack e))
|
||||
(rx/throw e))
|
||||
[error]
|
||||
(cond
|
||||
(and (:status error)
|
||||
(:payload error)
|
||||
(= (:status error) 403))
|
||||
(emit! (uxbox.data.auth/logout))
|
||||
|
||||
:else
|
||||
(do
|
||||
(uum/error (tr "errors.generic"))
|
||||
(println "Unexpected error: " error)
|
||||
(js/console.log (.-stack error))
|
||||
(rx/throw error))))
|
||||
|
||||
(defn init
|
||||
"Initializes the stream event loop and
|
||||
|
|
Loading…
Add table
Reference in a new issue