Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catching uncatchables #36

Open
olivergeorge opened this issue Mar 23, 2017 · 0 comments
Open

Catching uncatchables #36

olivergeorge opened this issue Mar 23, 2017 · 0 comments
Labels

Comments

@olivergeorge
Copy link

olivergeorge commented Mar 23, 2017

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)
@darwin darwin added the idea label May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants