Skip to content

Commit

Permalink
add try/catch in case transit-str fails
Browse files Browse the repository at this point in the history
hard to track down error otherwise
  • Loading branch information
thheller committed Oct 3, 2019
1 parent 989590b commit 4aa1a47
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/shadow/cljs/devtools/server/common.clj
Expand Up @@ -56,9 +56,12 @@
(fn [data]
(let [out (ByteArrayOutputStream. 4096)
w (transit/writer out :json)]
(transit/write w data)
(.toString out)
)))
(try
(transit/write w data)
(.toString out)
(catch Exception e
(log/warn-ex e ::transit-str-failed {:data data})
(throw e))))))

:stop (fn [x])}

Expand Down

0 comments on commit 4aa1a47

Please sign in to comment.