We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f9da0a commit 97b6d8cCopy full SHA for 97b6d8c
1 file changed
src/main/clojure/clojure/data/xml/jvm/emit.clj
@@ -29,9 +29,11 @@
29
30
(defn check-stream-encoding [^OutputStreamWriter stream xml-encoding]
31
(when (not= (Charset/forName xml-encoding) (Charset/forName (.getEncoding stream)))
32
- (throw (Exception. (str "Output encoding of stream (" xml-encoding
33
- ") doesn't match declaration ("
34
- (.getEncoding stream) ")")))))
+ (throw (ex-info (str "Output encoding of writer (" (.getEncoding stream)
+ ") doesn't match declaration ("
+ xml-encoding ")")
35
+ {:stream-encoding (.getEncoding stream)
36
+ :declared-encoding xml-encoding}))))
37
38
;; properly namespace aware version
39
(defn- emit-attrs [^XMLStreamWriter writer attrs]
0 commit comments