Add logging on EDN or JSON read error
This commit is contained in:
parent
feb48af75f
commit
9036af1957
1 changed files with 12 additions and 2 deletions
|
|
@ -80,8 +80,18 @@
|
|||
err-stream (:err pod)
|
||||
readers (:readers pod)
|
||||
read-fn (case format
|
||||
:edn #(edn/read-string {:readers readers} %)
|
||||
:json #(cheshire/parse-string-strict % true))]
|
||||
:edn (fn [s]
|
||||
(try (edn/read-string {:readers readers} s)
|
||||
(catch Exception e
|
||||
(binding [*out* *err*]
|
||||
(println "Cannot read EDN: " (pr-str s))
|
||||
(throw e)))))
|
||||
:json (fn [s]
|
||||
(try (cheshire/parse-string-strict s true)
|
||||
(catch Exception e
|
||||
(binding [*out* *err*]
|
||||
(println "Cannot read JSON: " (pr-str s))
|
||||
(throw e))))))]
|
||||
(try
|
||||
(loop []
|
||||
(let [reply (try (read stdout)
|
||||
|
|
|
|||
Loading…
Reference in a new issue