mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 16:46:37 +02:00
✨ Improve error reporting.
This commit is contained in:
parent
cf7664d446
commit
41a3f4483f
1 changed files with 5 additions and 2 deletions
|
@ -54,14 +54,17 @@
|
||||||
(defn- on-error
|
(defn- on-error
|
||||||
"A default error handler."
|
"A default error handler."
|
||||||
[{:keys [status] :as error}]
|
[{:keys [status] :as error}]
|
||||||
(js/console.error "on-error:" (pr-str error))
|
(js/console.error "Unhandled Error:"
|
||||||
(js/console.error (.-stack error))
|
"\n - message:" (ex-message error)
|
||||||
|
"\n - data:" (pr-str (ex-data error))
|
||||||
|
"\n - stack:" (.-stack error))
|
||||||
(reset! st/loader false)
|
(reset! st/loader false)
|
||||||
(cond
|
(cond
|
||||||
;; Unauthorized or Auth timeout
|
;; Unauthorized or Auth timeout
|
||||||
(and (:status error)
|
(and (:status error)
|
||||||
(or (= (:status error) 403)
|
(or (= (:status error) 403)
|
||||||
(= (:status error) 419)))
|
(= (:status error) 419)))
|
||||||
|
|
||||||
(ts/schedule 0 #(st/emit! (rt/nav :auth/login)))
|
(ts/schedule 0 #(st/emit! (rt/nav :auth/login)))
|
||||||
|
|
||||||
;; Conflict
|
;; Conflict
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue