binaryage / binaryage/cljs-devtools
Catching uncatchables
- Lingua principale
- Clojure
- Stelle
- 1.1k
- Fork
- 51
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
We were having trouble with spec errors in EventListeners. For example, spec errors thrown when handling the response to an ajax request were uncaught and printed badly.
There are Closure Library functions which can help with these cases. Possibly of use for cljs-devtools
```
(ns condense.preload
(:require [goog.debug.entryPointRegistry :as gepr])
(:import [goog.debug ErrorHandler]))
(defn handle-error [e]
(js/console.debug (.-stack e))
(js/console.debug (ex-data e)))
(def error-handler (doto (ErrorHandler. handle-error)
(.protectWindowSetTimeout)
(.protectWindowSetInterval)
(.protectWindowRequestAnimationFrame)))
(gepr/monitorAll error-handler)
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.