410 will get returned for deleted resources, treat the same as 404
This commit is contained in:
parent
aa32c20ba7
commit
cb4355768a
|
@ -183,8 +183,13 @@
|
||||||
base-url
|
base-url
|
||||||
relative-resource-url)
|
relative-resource-url)
|
||||||
(catch ExceptionInfo ex
|
(catch ExceptionInfo ex
|
||||||
(if (not= 404 (get-in (ex-data ex) [:object :status]))
|
(let [http-status (get-in (ex-data ex) [:object :status])]
|
||||||
(throw ex)))))
|
; TODO: do we want to handle 410 differently? either way, the resource is not available
|
||||||
|
; though, a 410 could indicate to the caller that it might be available under a
|
||||||
|
; previous version ...
|
||||||
|
(if-not (or (= http-status 404)
|
||||||
|
(= http-status 410))
|
||||||
|
(throw ex))))))
|
||||||
([base-url type id & {:keys [version]}]
|
([base-url type id & {:keys [version]}]
|
||||||
(let [resource-name (->fhir-resource-name type)
|
(let [resource-name (->fhir-resource-name type)
|
||||||
url-components (if version
|
url-components (if version
|
||||||
|
|
Reference in a new issue