diff --git a/src/compojure/api/exception.clj b/src/compojure/api/exception.clj index cc281da6..b6f6d47d 100644 --- a/src/compojure/api/exception.clj +++ b/src/compojure/api/exception.clj @@ -31,6 +31,8 @@ :request raw request :response raw response" [e data req] + (when (= (:uri req) "/resource") + (println "RESPONSE VALIDATION ERROR:" (get-in data [:problems]))) (response/internal-server-error (-> data (dissoc :request :response) @@ -50,6 +52,8 @@ :error schema error :request raw request" [e data req] + (when (= (:uri req) "/resource") + (println "REQUEST VALIDATION ERROR:" (get-in data [:problems]))) (response/bad-request (-> data (dissoc :request) diff --git a/test19/compojure/api/coercion/spec_coercion_test.clj b/test19/compojure/api/coercion/spec_coercion_test.clj index e5d3016b..26a72e6d 100644 --- a/test19/compojure/api/coercion/spec_coercion_test.clj +++ b/test19/compojure/api/coercion/spec_coercion_test.clj @@ -292,8 +292,8 @@ (let [[status body] (get* app "/resource" {:x 1, :y 2})] status => 200 body => {:total 3}) - (let [[status body] (get* app "/resource" {:x -1, :y -2})] - status => 500 + (let [[status body] (get* app "/resource" {:x -1, :y -3})] + status => 400 body => (contains {:coercion "spec" :in ["response" "body"]})))