binaryage / binaryage/cljs-devtools
Catching uncatchables
- Vorherrschende Sprache
- Clojure
- Sterne
- 1.1k
- Forks
- 51
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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)
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start by tracing how EventListeners handle spec errors from asynchronous Ajax responses, then compare that path with the Closure Library ErrorHandler and entryPointRegistry example in the issue. Done means these errors are caught and reported with useful stack and ex-data output; no source file or test is named, so the relevant integration point must be located first.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- clojure
- Bereich
- devtools
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100