From 01c89f6554f37d73d4d56a7e4bebde998353221d Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 28 Dec 2021 23:19:29 +0100 Subject: [PATCH] :bug: Set proper return value on validation error handler. --- backend/src/app/http/errors.clj | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/backend/src/app/http/errors.clj b/backend/src/app/http/errors.clj index fac709447..91b25beb1 100644 --- a/backend/src/app/http/errors.clj +++ b/backend/src/app/http/errors.clj @@ -55,17 +55,9 @@ (defmethod handle-exception :validation [err req] - (let [header (get-in req [:headers "accept"]) - edata (ex-data err)] - (if (and (= :spec-validation (:code edata)) - (str/starts-with? header "text/html")) - {:status 400 - :headers {"content-type" "text/html"} - :body (str "
"
-                  (:explain edata)
-                  "
\n")} - {:status 400 - :body (dissoc edata ::s/problems)}))) + (let [edata (ex-data err)] + {:status 400 + :body (dissoc edata ::s/problems)})) (defmethod handle-exception :assertion [error request]