You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@xmedeko Could you explain some details, please. As I understand you would like to add on_error argument into the Retry.__init__ method, but I really can not get how are you going to use it? Do you want it to be the class attribute, or you want it to be called in __init__?
@emar-kar I read the request that the on_error passed to the constructor would be saved as an attribute on the Retry instance, and used in every invocation as a fall-back if no on_error is passed. E.g.:
fromgoogle.api_core.retryimportRetrydeferror_callback(exception):
psasretry=Retry(on_error=error_callback)
# callback invoked for retryable exceptionsretry(some_object.delete)()
Activity
emar-kar commentedon Jul 25, 2019
@xmedeko Could you explain some details, please. As I understand you would like to add
on_errorargument into theRetry.__init__method, but I really can not get how are you going to use it? Do you want it to be the class attribute, or you want it to be called in__init__?tseaver commentedon Jul 25, 2019
@emar-kar I read the request that the
on_errorpassed to the constructor would be saved as an attribute on theRetryinstance, and used in every invocation as a fall-back if noon_erroris passed. E.g.:[-]Core: Retry.__init__ add on_error[/-][+]Core: Retry.__init__ add on_error arg[/+]