From 78871cab96d2c4fbb93189e2dc6327205c67b265 Mon Sep 17 00:00:00 2001 From: Leandro Doctors Date: Sat, 14 Dec 2024 13:15:20 +0100 Subject: [PATCH] Improve naming (preparation for #2126) * `generate-error-payload` (and not just `error`) is what the function actually does * Whereas the names `e` and `ex` are quite similar, they can still generate some confusion. --- modules/rest-util/src/blaze/middleware/fhir/output.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/rest-util/src/blaze/middleware/fhir/output.clj b/modules/rest-util/src/blaze/middleware/fhir/output.clj index 0c5dc5740..08fa16fbf 100644 --- a/modules/rest-util/src/blaze/middleware/fhir/output.clj +++ b/modules/rest-util/src/blaze/middleware/fhir/output.clj @@ -29,8 +29,8 @@ (def ^:private parse-accept (parse/fast-memoize 1000 parse/parse-accept)) -(defn- generate-error [generation-fn ex] - (-> ex +(defn- generate-error-payload [generation-fn e] + (-> e ba/anomaly handler-util/operation-outcome generation-fn)) @@ -51,7 +51,7 @@ (update response :body generate-xml**) (catch Throwable e (assoc response - :body (generate-error generate-xml** e) + :body (generate-error-payload generate-xml** e) :status 500)))) (defn- generate-xml [response] @@ -68,7 +68,7 @@ (update response :body generate-binary**) (catch Throwable e (assoc response - :body (generate-error identity e) + :body (generate-error-payload identity e) :status 500)))) (defn- generate-binary [response]