0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-11 01:28:30 -05:00

📎 Add hack for devtools unhandled rejection

This commit is contained in:
Andrey Antukh 2022-06-13 13:10:36 +02:00
parent e5cb5860a8
commit 1174590af4

View file

@ -184,14 +184,19 @@
(defn on-unhandled-error (defn on-unhandled-error
[error] [error]
(if (instance? ExceptionInfo error) (letfn [(is-ignorable-exception? [cause]
(-> error ex-data ptk/handle-error) (condp = (ex-message cause)
(let [hint (ex-message error) "Possible side-effect in debug-evaluate" true
msg (dm/str "Unhandled Internal Error: " hint)] false))]
(ts/schedule #(st/emit! (rt/assign-exception error))) (if (instance? ExceptionInfo error)
(js/console.group msg) (-> error ex-data ptk/handle-error)
(ex/ignoring (js/console.error error)) (when-not (is-ignorable-exception? error)
(js/console.groupEnd msg)))) (let [hint (ex-message error)
msg (dm/str "Unhandled Internal Error: " hint)]
(ts/schedule #(st/emit! (rt/assign-exception error)))
(js/console.group msg)
(ex/ignoring (js/console.error error))
(js/console.groupEnd msg))))))
(defonce uncaught-error-handler (defonce uncaught-error-handler
(letfn [(on-error [event] (letfn [(on-error [event]