diff options
Diffstat (limited to 'google/api_core/operation.py')
-rw-r--r-- | google/api_core/operation.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/google/api_core/operation.py b/google/api_core/operation.py index b17f753..a66e4a5 100644 --- a/google/api_core/operation.py +++ b/google/api_core/operation.py @@ -140,11 +140,11 @@ class Operation(polling.PollingFuture): ) self.set_exception(exception) else: - exception = exceptions.GoogleAPICallError( - "Unexpected state: Long-running operation had neither " - "response nor error set." - ) - self.set_exception(exception) + # Some APIs set `done: true`, with an empty response. + # Set the result to an empty message of the expected + # result type. + # https://google.aip.dev/151 + self.set_result(self._result_type()) def _refresh_and_update(self, retry=polling.DEFAULT_RETRY): """Refresh the operation and update the result if needed. |