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

      (when-not codec
        (throw (ex-info
                 (str "No codecs can encode value: " (pr-str value))
                 {:codecs (keys codecs)
                  :value value})))
      (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. 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
