Executes a Cloud API call and translates errors to EEExceptions. Args: call: The Cloud API call, with all parameters set, ready to have execute() called on it. num_retries: How many times retryable failures should be retried. Returns: The value returned by executing that call
(
call: googleapiclient.http.HttpRequest, num_retries: int | None = None
)
| 339 | |
| 340 | |
| 341 | def _execute_cloud_call( |
| 342 | call: googleapiclient.http.HttpRequest, num_retries: int | None = None |
| 343 | ) -> Any: |
| 344 | """Executes a Cloud API call and translates errors to EEExceptions. |
| 345 | |
| 346 | Args: |
| 347 | call: The Cloud API call, with all parameters set, ready to have execute() |
| 348 | called on it. |
| 349 | num_retries: How many times retryable failures should be retried. |
| 350 | |
| 351 | Returns: |
| 352 | The value returned by executing that call. |
| 353 | |
| 354 | Raises: |
| 355 | EEException if the call fails. |
| 356 | """ |
| 357 | num_retries = _get_state().max_retries if num_retries is None else num_retries |
| 358 | try: |
| 359 | return call.execute(num_retries=num_retries) |
| 360 | except googleapiclient.errors.HttpError as e: |
| 361 | raise _translate_cloud_exception(e) # pylint: disable=raise-missing-from |
| 362 | |
| 363 | |
| 364 | def _translate_cloud_exception( |
no test coverage detected