Improve error reporting

This commit is contained in:
Andrey Antukh 2022-04-01 17:16:59 +02:00 committed by Andrés Moya
parent 701a98fab6
commit ca02999ae9
3 changed files with 54 additions and 7 deletions

View file

@ -59,7 +59,9 @@
(-> (method data)
(p/then handle-response)
(p/then respond)
(p/catch raise)))))
(p/catch (fn [cause]
(let [context {:profile-id profile-id}]
(raise (ex/wrap-with-context cause context)))))))))
(defn- rpc-mutation-handler
"Ring handler that dispatches mutation requests and convert between
@ -81,7 +83,9 @@
(-> (method data)
(p/then handle-response)
(p/then respond)
(p/catch raise)))))
(p/catch (fn [cause]
(let [context {:profile-id profile-id}]
(raise (ex/wrap-with-context cause context)))))))))
(defn- wrap-metrics
"Wrap service method with metrics measurement."