       (try
         (._run this)
         (catch :default e
-          ;; Just log error: it will most likely pop up again at deref time.
-          (error "Error in reaction:" e)
           (set! state nil)
+          (set! caught e)
           (notify-w this e nil)))))
 
   (_run [this]



(defn make-reaction [f & {:keys [auto-run on-set on-dispose]}]
  (let [reaction (Reaction. f nil true false nil nil nil)]
    (._set-opts reaction {:auto-run auto-run
                          :on-set on-set
                          :on-dispose on-dispose})



(deftype Reaction [f ^:mutable state ^:mutable ^boolean dirty? ^boolean nocache?
                   ^:mutable watching ^:mutable watches ^:mutable auto-run
                   ^:mutable caught]
  IAtom
  IReactiveAtom

