From a6fc5239121f82a40acd799ffef14f45d09cba88 Mon Sep 17 00:00:00 2001 From: Adrian Gruntkowski Date: Tue, 9 Oct 2012 09:35:40 +0200 Subject: [PATCH] Make clj-http throw entire message, not just status code. --- src/clojure/clojurewerkz/neocons/rest.clj | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/clojure/clojurewerkz/neocons/rest.clj b/src/clojure/clojurewerkz/neocons/rest.clj index 858d886..cc68fec 100644 --- a/src/clojure/clojurewerkz/neocons/rest.clj +++ b/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}))))