From bb8c8f5a0c14e0bf472074ac6ab969ecb4966cca Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 21 Nov 2023 23:35:35 +0100 Subject: [PATCH] :sparkles: Add minor improvements to error reporting --- backend/src/app/rpc/commands/files_update.clj | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/src/app/rpc/commands/files_update.clj b/backend/src/app/rpc/commands/files_update.clj index ff44a1007e..92d14d96ab 100644 --- a/backend/src/app/rpc/commands/files_update.clj +++ b/backend/src/app/rpc/commands/files_update.clj @@ -18,6 +18,7 @@ [app.config :as cf] [app.db :as db] [app.features.fdata :refer [enable-pointer-map enable-objects-map]] + [app.http.errors :as errors] [app.loggers.audit :as audit] [app.loggers.webhooks :as webhooks] [app.metrics :as mtx] @@ -172,9 +173,12 @@ {:features features} {:id (:id team)}))) - (-> (update-file cfg params) - (rph/with-defer #(let [elapsed (tpoint)] - (l/trace :hint "update-file" :time (dt/format-duration elapsed))))))))) + (binding [l/*context* (some-> (meta params) + (get :app.http/request) + (errors/request->context))] + (-> (update-file cfg params) + (rph/with-defer #(let [elapsed (tpoint)] + (l/trace :hint "update-file" :time (dt/format-duration elapsed)))))))))) (defn update-file [{:keys [::db/conn ::mtx/metrics] :as cfg}