This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Timeouts on downloads do not raise TimeoutRequestError #93
Labels
bug
Something isn't working
Comments
3 tasks
Removing this big |
IIRC I added it to make sure in any case we at least raise |
With more coffee, I saw the right code in the file. |
kushaldas
added a commit
that referenced
this issue
Jun 19, 2019
redshiftzero
added a commit
that referenced
this issue
Jun 19, 2019
Fixes #93 raises the TimeOutErrors properly
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In #80 we added timeouts support into the SDK, such that in the client side, we could just handle the SDK's
RequestTimeoutError
which is what we are now doing: https://github.com/freedomofpress/securedrop-client/blob/master/securedrop_client/queue.py#L42.However for reply and submission downloads
RequestTimeoutError
s do not raise, due to this line: https://github.com/freedomofpress/securedrop-sdk/blob/master/sdclientapi/__init__.py#L607 which will cause the exception type raised to beBaseError
.This behavior was discovered by @creviera in freedomofpress/securedrop-client#421 (review)
Steps to reproduce
Add a
time.sleep(10)
to trigger timeouts in the API method for submission downloads: https://github.com/freedomofpress/securedrop/blob/develop/securedrop/journalist_app/api.py#L188Start the SecureDrop server container
Now try to use the SDK to download files:
Expected Behavior
RequestTimeoutError
is raised and then handled, andWe should get here!
is printedActual Behavior
The type of the exception that is ultimately raised is
BaseError
:Solution
RequestTimeoutError
to raise for timeouts ondownload_submission
anddownload_reply
The text was updated successfully, but these errors were encountered: