Permalink
Browse files

Merge pull request #16 from zoldar/more-elaborate-http-exceptions

Make clj-http throw entire message, not just status code.
  • Loading branch information...
2 parents e94b923 + a6fc523 commit 5d3da47213698521b1c1e229051da7d60c88c7e8 Michael Klishin committed Oct 9, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/clojure/clojurewerkz/neocons/rest.clj
@@ -13,28 +13,31 @@
[^String s]
(get (System/getenv) s))
+(def ^{:private true}
+ global-options {:throw-entire-message? true})
+
(def ^{:private true}
http-authentication-options {})
(defn GET
[^String uri & {:as options}]
(io!
- (http/get uri (merge http-authentication-options options {:accept :json}))))
+ (http/get uri (merge global-options http-authentication-options options {:accept :json}))))
(defn POST
[^String uri &{:keys [body] :as options}]
(io!
- (http/post uri (merge http-authentication-options options {:accept :json :content-type :json :body body}))))
+ (http/post uri (merge global-options http-authentication-options options {:accept :json :content-type :json :body body}))))
(defn PUT
[^String uri &{:keys [body] :as options}]
(io!
- (http/put uri (merge http-authentication-options options {:accept :json :content-type :json :body body}))))
+ (http/put uri (merge global-options http-authentication-options options {:accept :json :content-type :json :body body}))))
(defn DELETE
[^String uri &{:keys [body] :as options}]
(io!
- (http/delete uri (merge http-authentication-options options {:accept :json}))))
+ (http/delete uri (merge global-options http-authentication-options options {:accept :json}))))

0 comments on commit 5d3da47

Please sign in to comment.