diff --git a/backend/src/app/http.clj b/backend/src/app/http.clj index e826b6c88..a0d872e35 100644 --- a/backend/src/app/http.clj +++ b/backend/src/app/http.clj @@ -77,7 +77,9 @@ (handler request) (catch Throwable e (l/with-context (errors/get-error-context request e) - (l/error :hint (ex-message e) :cause e) + (l/error :hint "unexpected error processing request" + :query-string (:query-string request) + :cause e) {:status 500 :body "internal server error"})))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/backend/src/app/http/debug.clj b/backend/src/app/http/debug.clj index d13e38be9..9b74ad43c 100644 --- a/backend/src/app/http/debug.clj +++ b/backend/src/app/http/debug.clj @@ -150,7 +150,7 @@ (binding [ppr/*print-right-margin* 300] (let [context (dissoc report :trace :cause :params :data :spec-problems - :spec-value :error :explain :hint :message) + :spec-value :error :explain :hint) params {:context (with-out-str (ppr/pprint context)) :hint (:hint report) :spec-problems (:spec-problems report) diff --git a/backend/src/app/http/errors.clj b/backend/src/app/http/errors.clj index b7424403f..216fe9127 100644 --- a/backend/src/app/http/errors.clj +++ b/backend/src/app/http/errors.clj @@ -34,7 +34,6 @@ :data (some-> data (dissoc ::s/problems ::s/value :hint)) :ip-addr (parse-client-ip request) :profile-id (:profile-id request)} - (let [headers (:headers request)] {:user-agent (get headers "user-agent") :frontend-version (get headers "x-frontend-version" "unknown")})))) diff --git a/backend/src/app/http/middleware.clj b/backend/src/app/http/middleware.clj index a8cf67445..265c3198e 100644 --- a/backend/src/app/http/middleware.clj +++ b/backend/src/app/http/middleware.clj @@ -70,6 +70,7 @@ (let [body (:body response) params (:query-params request) opts {:type (if (contains? params "transit_verbose") :json-verbose :json)}] + (cond (:ws response) response