       (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})


  IDeref
  (-deref [this]
    (when-some [e caught]
      (set! caught nil)
      (throw e))
    (let [non-reactive (nil? *ratom-context*)]
      (when non-reactive
        (flush!))
