binaryage / binaryage/cljs-devtools
Catching uncatchables
- Dominant language
- Clojure
- Stars
- 1.1k
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
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)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
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.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100