mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 00:58:26 -05:00
📎 Add hack for devtools unhandled rejection
This commit is contained in:
parent
e5cb5860a8
commit
1174590af4
1 changed files with 13 additions and 8 deletions
|
@ -184,14 +184,19 @@
|
|||
|
||||
(defn on-unhandled-error
|
||||
[error]
|
||||
(if (instance? ExceptionInfo error)
|
||||
(-> error ex-data ptk/handle-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))))
|
||||
(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))))))
|
||||
|
||||
(defonce uncaught-error-handler
|
||||
(letfn [(on-error [event]
|
||||
|
|
Loading…
Add table
Reference in a new issue