From a87b76cc60b9d21cb162a0f43a446818cc796995 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Tue, 14 Feb 2017 15:33:43 +0100 Subject: [PATCH] Prevent compojure-api handle unknown exceptions --- src/asciinema/endpoint/asciicasts.clj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/asciinema/endpoint/asciicasts.clj b/src/asciinema/endpoint/asciicasts.clj index 8674d61..f43fd74 100644 --- a/src/asciinema/endpoint/asciicasts.clj +++ b/src/asciinema/endpoint/asciicasts.clj @@ -7,8 +7,12 @@ [ring.util.http-response :as response] [schema.core :as s])) +(defn exception-handler [^Exception e data request] + (throw e)) + (defn asciicasts-endpoint [{:keys [db file-server]}] (api + {:exceptions {:handlers {:compojure.api.exception/default exception-handler}}} (context "/a" [] (GET "/:token.json" []