From 1c42ace096c8ba65cc2328beeb72613ddb32bdc3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 26 Jan 2021 16:49:06 +0100 Subject: [PATCH] :bug: Properly capture stack overflow errors. --- backend/src/app/http.clj | 4 ++-- backend/src/app/http/middleware.clj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/app/http.clj b/backend/src/app/http.clj index 927c7f8675..2c31da214d 100644 --- a/backend/src/app/http.clj +++ b/backend/src/app/http.clj @@ -104,14 +104,14 @@ (fn [request] (try (handler request) - (catch Exception e + (catch Throwable e (try (let [cdata (errors/get-error-context request e)] (errors/update-thread-context! cdata) (log/errorf e "Unhandled exception: %s (id: %s)" (ex-message e) (str (:id cdata))) {:status 500 :body "internal server error"}) - (catch Exception e + (catch Throwable e (log/errorf e "Unhandled exception: %s" (ex-message e)) {:status 500 :body "internal server error"}))))))) diff --git a/backend/src/app/http/middleware.clj b/backend/src/app/http/middleware.clj index 50cad7458d..a77716f4de 100644 --- a/backend/src/app/http/middleware.clj +++ b/backend/src/app/http/middleware.clj @@ -111,7 +111,7 @@ (fn [request] (try (handler request) - (catch Exception e + (catch Throwable e (on-error e request))))) (def errors