From faecfe712de7b6b16c33f75b13ed2b16ab5d4309 Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 14 Feb 2015 20:25:56 -0500 Subject: [PATCH] fix check for whether the fail-response needs to be returned --- src/clj_webtoolbox/routes/checked.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/clj_webtoolbox/routes/checked.clj b/src/clj_webtoolbox/routes/checked.clj index 5d93f77..c0f5339 100644 --- a/src/clj_webtoolbox/routes/checked.clj +++ b/src/clj_webtoolbox/routes/checked.clj @@ -16,7 +16,8 @@ (defmacro threaded-checks [request checks fail-response] `(let [result# (pred-> ~request no-errors? ~@checks)] - (if (request? result#) + (if (and (request? result#) + (not (no-errors? result#))) (if (response? ~fail-response) ~fail-response (~fail-response result#))