def add_handler(self,
error_handler: object
)
def error_handler_callback(
error_manager: errors.ErrorManager,
error_source: client.BaseClient,
error_instance: errors.ActionError,
error_retry_count: int
) -> int:
if not isinstance(error_instance, errors.ActionError):
return errors.ErrorHandlerResult.Ignore
if error_instance.action_id == 'FailedOperation':
return errors.ErrorHandlerResult.Backoff
else:
return errors.ErrorHandlerResult.Throw
function_client.error_manager.add_handler(
error_handler = error_handler_callback
)
Tencent Cloud SDK for Python