Skip to content

Commit

Permalink
Improve naming (preparation for #2126)
Browse files Browse the repository at this point in the history
* `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.
  • Loading branch information
allentiak committed Dec 14, 2024
1 parent 45f8df4 commit 78871ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/rest-util/src/blaze/middleware/fhir/output.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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]
Expand All @@ -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]
Expand Down

0 comments on commit 78871ca

Please sign in to comment.