Skip to content

Commit

Permalink
don't return exceptions as :value
Browse files Browse the repository at this point in the history
  • Loading branch information
cemerick committed Sep 29, 2010
1 parent 4ca5636 commit bf4713d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/clojure/cemerick/nrepl.clj
Expand Up @@ -165,7 +165,7 @@
:read (fn [prompt exit] (read code-reader false exit))
:caught (fn [#^Throwable e]
(swap! client-state-atom assoc :last-exception e)
(reset! return ["error" e])
(reset! return ["error" nil])
(if *print-stack-trace-on-error*
(.printStackTrace e *out*)
(prn (clojure.main/repl-exception e)))
Expand Down
4 changes: 2 additions & 2 deletions src/test/clojure/cemerick/nrepl_test.clj
Expand Up @@ -61,9 +61,9 @@
(is (= history (repl-value "*1")))))

(def-repl-test exceptions
(let [{:keys [out status value] :as f} (repl-receive "(throw (Exception. \"bad, bad code\"))")]
(let [{:keys [out status value] :as f} (repl-read "(throw (Exception. \"bad, bad code\"))")]
(is (= "error" status))
(is (.contains value "bad, bad code"))
(is (nil? value))
(is (.contains out "bad, bad code"))
(is (= true (repl-value "(.contains (str *e) \"bad, bad code\")")))))

Expand Down

0 comments on commit bf4713d

Please sign in to comment.