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



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


(defn- find-decodable

    (throw (IllegalArgumentException.
             "mux-codec must be given an even number of arguments")))
  (let [codec-map (apply array-map codecs)]
    (MuxCodec. codec-map)))


