Skip to content

Commit

Permalink
[Fix clojure-emacs/cider#1362] Handle properly macroexpansion exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Oct 17, 2015
1 parent 9ddbbc2 commit 585b416
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cider/nrepl/middleware/macroexpand.clj
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@

(defn macroexpansion-reply
[{:keys [transport expander code ns display-namespaces print-meta] :as msg}]
(let [expansion (macroexpansion expander code ns display-namespaces print-meta)]
(try
(try
(let [expansion (macroexpansion expander code ns display-namespaces print-meta)]
(transport/send
transport
(response-for msg :expansion expansion :status :done))
(catch Exception e
(transport/send
transport (response-for msg (u/err-info e :macroexpand-error)))))))
(response-for msg :expansion expansion :status :done)))
(catch Exception e
(transport/send
transport (response-for msg (u/err-info e :macroexpand-error))))))

(defn wrap-macroexpand
"Middleware that provides macroexpansion ops."
Expand Down

0 comments on commit 585b416

Please sign in to comment.