This PR introduces changes to unify exceptions between DICOMwebClient and DICOMfileClient. Specifically, it ensures that errors that would result in requests.HTTPError exceptions in DICOMwebClient are handled the same way by DICOMfileClient, including HTTP status codes to differentiate between client (4XX) and server (5XX) errors.
It is a bit weird for DICOMfileClient to raise requests.HTTPError, because the client does not rely on HTTP. Ultimately, it would probably be nice to fully abstract the error handling logic via a custom exception class. However, that would break existing behavior of the DICOMwebClient. It's something we could consider for version 1.0.
This PR introduces changes to unify exceptions between
DICOMwebClient
andDICOMfileClient
. Specifically, it ensures that errors that would result inrequests.HTTPError
exceptions inDICOMwebClient
are handled the same way byDICOMfileClient
, including HTTP status codes to differentiate between client (4XX) and server (5XX) errors.It is a bit weird for
DICOMfileClient
to raiserequests.HTTPError
, because the client does not rely on HTTP. Ultimately, it would probably be nice to fully abstract the error handling logic via a custom exception class. However, that would break existing behavior of theDICOMwebClient
. It's something we could consider for version 1.0.