0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 09:08:31 -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
[error]
(letfn [(is-ignorable-exception? [cause]
(condp = (ex-message cause)
"Possible side-effect in debug-evaluate" true
false))]
(if (instance? ExceptionInfo error)
(-> error ex-data ptk/handle-error)
(when-not (is-ignorable-exception? error)
(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))))
(js/console.groupEnd msg))))))
(defonce uncaught-error-handler
(letfn [(on-error [event]