mirror of
https://github.com/penpot/penpot.git
synced 2025-07-18 17:37:13 +02:00
✨ Minor improvements on error handling on frontend.
This commit is contained in:
parent
594bceff77
commit
4ee1f9cf2c
5 changed files with 20 additions and 18 deletions
|
@ -101,7 +101,7 @@
|
|||
(mf/defc on-main-error
|
||||
[{:keys [error] :as props}]
|
||||
(let [data (ex-data error)]
|
||||
(ptk/handle-error error)
|
||||
(mf/use-effect #(ptk/handle-error error))
|
||||
[:span "Internal application errror"]))
|
||||
|
||||
(mf/defc main-page
|
||||
|
@ -285,22 +285,17 @@
|
|||
(ptk/handle-error (ex-data error))
|
||||
(do
|
||||
(ts/schedule
|
||||
(st/emitf (dm/show
|
||||
{:content "Something wrong has happened."
|
||||
:type :error
|
||||
:timeout 3000})))
|
||||
(st/emitf (dm/assign-exception error)))
|
||||
|
||||
(js/console.group "Internal error:")
|
||||
(js/console.log "hint:" (or (ex-message error)
|
||||
(:hint error)
|
||||
(:message error)))
|
||||
(ex/ignoring
|
||||
(js/console.error "repr: " (pr-str error))
|
||||
(js/console.error "data: " (clj->js error))
|
||||
(js/console.error (clj->js error))
|
||||
(js/console.error "stack:" (.-stack error)))
|
||||
(js/console.groupEnd "Internal error:"))))
|
||||
|
||||
|
||||
(defonce uncaught-error-handler
|
||||
(letfn [(on-error [event]
|
||||
(ptk/handle-error (unchecked-get event "error"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue