HypeTutorials / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

[FR] Pass batch response status in callback #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Change the callback signature to include the httplib2.Response object returned 
by the multi-part batch response so that client applications can check for 
errors (status code > 300).

This should be an easy fix in apiclient.http in the BatchHttpRequest.execute 
method (last 4 lines):

      if cb is not None:
        cb(headers, request_id, response)
      if self._callback is not None:
        self._callback(headers, request_id, response)

"headers" is an httplib2.Response object that is retrieved from this line:
      headers, content = self._deserialize_response(part.get_payload())

Original issue reported on code.google.com by ala...@google.com on 7 Jan 2012 at 12:05

GoogleCodeExporter commented 8 years ago
Hum, actually on failure, the response should be something like:
{
  "error": {
      ...
  }
}

Please set this FR as invalid.

Original comment by ala...@google.com on 7 Jan 2012 at 12:11

GoogleCodeExporter commented 8 years ago

Original comment by jcgregorio@google.com on 8 Jan 2012 at 12:35