Skip to content

Commit d36a9e5

Browse files
committed
Catch requests.exceptions.ReadTimeout when removing container
We are already catching other similar exceptions here, log them and continuing with the build. However, there is now another similar exception `requests.exceptions.ReadTimeout` that's causing some builds to fail. This commit catchs this exceptions and makes the build to behave in the same way as we are doing with similar exceptions.
1 parent b3c54a1 commit d36a9e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

readthedocs/doc_builder/environments.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from docker.errors import APIError as DockerAPIError
1717
from docker.errors import DockerException
1818
from docker.errors import NotFound as DockerNotFoundError
19-
from requests.exceptions import ConnectionError
19+
from requests.exceptions import ConnectionError, ReadTimeout
2020
from requests_toolbelt.multipart.encoder import MultipartEncoder
2121
from slumber.exceptions import HttpClientError
2222

@@ -906,7 +906,7 @@ def __exit__(self, exc_type, exc_value, tb):
906906
)
907907
# Catch direct failures from Docker API or with an HTTP request.
908908
# These errors should not surface to the user.
909-
except (DockerAPIError, ConnectionError):
909+
except (DockerAPIError, ConnectionError, ReadTimeout):
910910
log.exception(
911911
LOG_TEMPLATE,
912912
{

0 commit comments

Comments
 (0)