Permalink
Browse files

Don't try to catch ExceptionInfo on older versions of Clojure.

We had a dependency on 1.4 sneak in here.
  • Loading branch information...
1 parent 02a78ed commit ef5457d6ef61424b26758d8ad770d3570602dc14 @technomancy committed Oct 29, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/clj/reply/main.clj
View
@@ -36,12 +36,13 @@
clojure.repl/pst clj-stacktrace.repl/pst]
(reader.jline/setup-reader! ~options)
~@body)
- (catch clojure.lang.ExceptionInfo e#
- (let [status# (:status (:object (ex-data e#)))
- body# (:body (:object (ex-data e#)))]
- (cond (= 401 status#) (println "Unauthorized.")
- (number? status#) (println "Remote error:" (slurp body#))
- :else (clojure.repl/pst e#))))
+ ~(if (resolve 'ex-info)
+ '(catch clojure.lang.ExceptionInfo e
+ (let [status# (:status (:object (ex-data e)))
+ body# (:body (:object (ex-data e)))]
+ (cond (= 401 status#) (println "Unauthorized.")
+ (number? status#) (println "Remote error:" (slurp body))
+ :else (clojure.repl/pst e)))))
(catch Throwable t# (clojure.repl/pst t#))
(finally (exit/exit))))

0 comments on commit ef5457d

Please sign in to comment.