Fixed the explosion of REPL on bad input.

This commit is contained in:
Isaac Hodes 2010-08-22 22:30:03 -04:00 committed by Phil Hagelberg
parent a21362699d
commit 8ec9b4a9ba

View file

@ -58,7 +58,8 @@
(defn- repl-client [reader writer]
(copy-out reader)
(let [eof (Object.)
input (read *in* false eof)]
input (try (read *in* false eof)
(catch Exception e nil))]
(when-not (= eof input)
(.write writer (str (pr-str input) "\n"))
(.flush writer)