File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,9 @@ def if_exception_type_predicate(exception):
9898# Pylint sees this as a constant, but it is also an alias that should be
9999# considered a function.
100100if_transient_error = if_exception_type (
101- (exceptions .InternalServerError , exceptions .TooManyRequests )
101+ exceptions .InternalServerError ,
102+ exceptions .TooManyRequests ,
103+ exceptions .ServiceUnavailable ,
102104)
103105"""A predicate that checks if an exception is a transient API error.
104106
@@ -107,6 +109,7 @@ def if_exception_type_predicate(exception):
107109- :class:`google.api_core.exceptions.InternalServerError` - HTTP 500, gRPC
108110 ``INTERNAL(13)`` and its subclasses.
109111- :class:`google.api_core.exceptions.TooManyRequests` - HTTP 429
112+ - :class:`google.api_core.exceptions.ServiceUnavailable` - HTTP 503
110113- :class:`google.api_core.exceptions.ResourceExhausted` - gRPC
111114 ``RESOURCE_EXHAUSTED(8)``
112115"""
Original file line number Diff line number Diff line change 3939 'futures >= 3.2.0; python_version < "3.2"' ,
4040]
4141extras = {
42- "grpc" : "grpcio >= 1.8.2" ,
42+ "grpc" : "grpcio >= 1.8.2, < 2.0dev " ,
4343 "grpcgcp" : "grpcio-gcp >= 0.2.2" ,
4444 "grpcio-gcp" : "grpcio-gcp >= 0.2.2" ,
4545}
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ def test_if_exception_type_multiple():
4141def test_if_transient_error ():
4242 assert retry .if_transient_error (exceptions .InternalServerError ("" ))
4343 assert retry .if_transient_error (exceptions .TooManyRequests ("" ))
44+ assert retry .if_transient_error (exceptions .ServiceUnavailable ("" ))
4445 assert not retry .if_transient_error (exceptions .InvalidArgument ("" ))
4546
4647
You can’t perform that action at this time.
0 commit comments