dicomweb-client
dicomweb-client copied to clipboard
Unify exceptions between web and file clients
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.