Skip to content

Commit 9c96d60

Browse files
authored
Merge pull request #890 from H-PRessl/master
add exceptions parameter to client_object.execute_query_retry to mirror client_runtime_context.execute_query_retry
2 parents 1001db4 + 3e76892 commit 9c96d60

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

office365/runtime/client_object.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from requests import Response
77
from typing_extensions import Self
88

9+
from office365.runtime.client_request_exception import ClientRequestException
910
from office365.runtime.client_runtime_context import ClientRuntimeContext
1011
from office365.runtime.client_value import ClientValue
1112
from office365.runtime.http.request_options import RequestOptions
@@ -55,7 +56,12 @@ def execute_query(self):
5556
return self
5657

5758
def execute_query_retry(
58-
self, max_retry=5, timeout_secs=5, success_callback=None, failure_callback=None
59+
self,
60+
max_retry=5,
61+
timeout_secs=5,
62+
success_callback=None,
63+
failure_callback=None,
64+
exceptions=(ClientRequestException,)
5965
):
6066
"""
6167
Executes the current set of data retrieval queries and method invocations and retries it if needed.
@@ -66,12 +72,14 @@ def execute_query_retry(
6672
if the request executes successfully.
6773
:param (int, requests.exceptions.RequestException)-> None failure_callback: A callback to call if the request
6874
fails to execute
75+
:param exceptions: tuple of exceptions that we retry
6976
"""
7077
self.context.execute_query_retry(
7178
max_retry=max_retry,
7279
timeout_secs=timeout_secs,
7380
success_callback=success_callback,
7481
failure_callback=failure_callback,
82+
exceptions=exceptions
7583
)
7684
return self
7785

0 commit comments

Comments
 (0)