Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/uipath-platform/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-platform"
version = "0.2.39"
version = "0.2.40"
description = "HTTP client library for programmatic access to UiPath Platform"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
5 changes: 3 additions & 2 deletions packages/uipath-platform/src/uipath/platform/common/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import random

from httpx import ConnectTimeout, HTTPStatusError, Response, TimeoutException
from httpx import ConnectError, HTTPStatusError, Response, TimeoutException
from tenacity import RetryCallState

from ..errors import EnrichedException
Expand Down Expand Up @@ -67,7 +67,8 @@ def extract_retry_after_from_chain(exception: BaseException) -> float | None:

def is_retryable_platform_exception(exception: BaseException) -> bool:
"""Return True if the exception is transient and should be retried."""
if isinstance(exception, (ConnectTimeout, TimeoutException)):
# A failed connect never sent the request, so any method is safe to retry.
if isinstance(exception, (ConnectError, TimeoutException)):
return True
if isinstance(exception, EnrichedException):
return exception.status_code in RETRYABLE_STATUS_CODES
Expand Down
4 changes: 4 additions & 0 deletions packages/uipath-platform/tests/services/test_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ def test_timeout_exception(self):
err = httpx.TimeoutException("timed out")
assert is_retryable_platform_exception(err) is True

def test_connect_error(self):
err = httpx.ConnectError("[Errno 104] Connection reset by peer")
assert is_retryable_platform_exception(err) is True

def test_enriched_408(self):
http_err = _make_http_status_error(408)
err = EnrichedException(http_err)
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath-platform/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/uipath/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading