0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 00:01:51 -05:00

Improve error reporting.

This commit is contained in:
Andrey Antukh 2019-08-21 21:04:41 +00:00
parent cf7664d446
commit 41a3f4483f

View file

@ -54,14 +54,17 @@
(defn- on-error
"A default error handler."
[{:keys [status] :as error}]
(js/console.error "on-error:" (pr-str error))
(js/console.error (.-stack error))
(js/console.error "Unhandled Error:"
"\n - message:" (ex-message error)
"\n - data:" (pr-str (ex-data error))
"\n - stack:" (.-stack error))
(reset! st/loader false)
(cond
;; Unauthorized or Auth timeout
(and (:status error)
(or (= (:status error) 403)
(= (:status error) 419)))
(ts/schedule 0 #(st/emit! (rt/nav :auth/login)))
;; Conflict