 
 (defn localdb-decompress [x]
   (nippy/thaw x local-db-decompress-opts))
+
+(nippy/extend-freeze clojure.lang.ExceptionInfo :onyx/exception-info
+                     [x data-output]
+                     (.writeUTF data-output (str {:ex (.getData x)
+                                                  :str (.getMessage x)
+                                                  :cause (.getCause x)})))
+
+(nippy/extend-thaw :onyx/exception-info
+                   [data-input]
+                   (let [{:keys [ex str cause]} (read-string (.readUTF data-input))]
+                     (when cause (println cause))
+                     (clojure.lang.ExceptionInfo. str ex cause)))

  (nippy/thaw x messaging-decompress-opts))

(def zookeeper-compress-opts {})

(defn zookeeper-compress [x]
  (nippy/freeze x zookeeper-compress-opts))

(def zookeeper-decompress-opts {:v1-compatibility? false})

(ns onyx.compression.nippy
  (:require [taoensso.nippy :as nippy]
            [schema.utils :as su])
  (:import [schema.utils ValidationError NamedError]))

(nippy/extend-freeze
 clojure.lang.ExceptionInfo :schema/validation-error
