You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if we should handle all exceptions thrown by Fetcher implementations (and throw a generic error that clients can actually handle)?
This issue can be tested with examples/client_example/client_example.py: if e.g. server is not running there's a requests ConnectionError. All requests errors do derive from OSError so it gets handled by the example code but another fetcher implementation might not do the same.
Alternatively we can just say that Fetcher implementations should document what gets thrown (and requestsFetcher could just link to RequestException)
The text was updated successfully, but these errors were encountered:
I think Fetcher should handle all exceptions, and raise a FetcherError which should derive from DownloadError -- this means client can just handle DownloadError which is what they probably want
Actually, there is no need for separate DownloadError and FetcherError: they are one and same (all DownloadErrors come from fetcher). We just need to document the fetcherinterface so that the methods are only allowed to raise DownloadErrors and derivatives -- or handle that in the interface itself. RequestsFetcher needs a small modification so fetch() actually enforces this requirement.
I wonder if we should handle all exceptions thrown by Fetcher implementations (and throw a generic error that clients can actually handle)?
This issue can be tested with
examples/client_example/client_example.py
: if e.g. server is not running there's a requestsConnectionError
. All requests errors do derive fromOSError
so it gets handled by the example code but another fetcher implementation might not do the same.Alternatively we can just say that Fetcher implementations should document what gets thrown (and requestsFetcher could just link to RequestException)
The text was updated successfully, but these errors were encountered: