0
Fork 0
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:
Andrey Antukh 2016-04-14 21:13:25 +03:00
parent e103335cc1
commit 51f1ac54d9
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -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