       (when-not codec
         (throw (ex-info
                  (str "No codecs can encode value: " (pr-str value))
-                 {:codecs (keys codecs)
+                 {:type ::no-codec
+                  :codecs (keys codecs)
                   :value value})))
       (when (thread-bound? #'*dispatched-codec*)
         (set! *dispatched-codec* codec-key))

    (throw (IllegalArgumentException.
             "mux-codec must be given an even number of arguments")))
  (let [codec-map (apply array-map codecs)]
    (when-let [bad-codecs (seq (remove (comp string? :header)
                                       (vals codec-map)))]
      (throw (IllegalArgumentException.
               (str "Every codec must specify a header path: "
                    (pr-str bad-codecs)))))
    (MuxCodec. codec-map)))





(defn- find-encodable
  "Finds the first codec in the map which can encode the given value. Only
  codecs with headers are considered. Returns a vector of the key and codec
  entry, or nil if none are found."
  [codecs value]
  (first (filter #(and (:header (val %)) (codec/encodable? (val %) value))
                 codecs)))


(defn- find-decodable
