 
 (def response-queues (atom {}))
 
-(defn notify-all-queues-of-error []
+(defn notify-all-queues-of-error [e]
   (doseq [session-key (keys @response-queues)]
     (.offer ^LinkedBlockingQueue (@response-queues session-key)
-            {:status "error" :global true})))
+            {:status ["error"] :global true :error e})))
 
 (defn session-responses [session]
   (lazy-seq

  (let [relevant-message (or (= command-id (:id message)) (:global message))
        error (some #{"error" "eval-error"} (:status message))
        done (some #{"done" "interrupted"} (:status message))]

    (when error
      (when-let [caught (:caught options)]
        (execute-with-client client options (str "(" (pr-str caught) ")"))))

    (and relevant-message (or error done))))


            (flush))
          :success
          (catch Throwable t
            (notify-all-queues-of-error t)
            (when (System/getenv "DEBUG") (clojure.repl/pst t))
            :failure))]
    (when (= :success continue)
