Closed GoogleCodeExporter closed 9 years ago
This issue was closed by revision 84c1ea7c1fe6.
Original comment by jcgregorio@google.com
on 25 Jul 2012 at 3:32
The bad_errors_issue.py script still shows less information in the batch case.
Specifically, it would be nice to get the
"You already own this bucket. Please select another name."
message in the batch error.
Adding print statements to
https://code.google.com/p/google-api-python-client/source/browse/apiclient/http.py#1125
reveals that the desired message is available to BatchHttpRequest.
Original comment by yova...@google.com
on 25 Jul 2012 at 3:47
Did you run this against head? I'm see the exact same information running that
script.
Original comment by jcgregorio@google.com
on 25 Jul 2012 at 4:00
I synced my checkout of the client library, and it does appear to contain your
changes if that's what you're asking.
The batch request yields:
<HttpError 403 when requesting
https://www.googleapis.com/storage/v1beta1/b?alt=json returned "Forbidden">
while an individual request gets:
<HttpError 403 when requesting
https://www.googleapis.com/storage/v1beta1/b?alt=json returned "You already own
this bucket. Please select another name.">
Original comment by yova...@google.com
on 25 Jul 2012 at 4:06
Interesting, you should only get the following type of message if the JSON
error message wasn't able to be parsed:
<HttpError 403 when requesting https://www.googleapis.com/storage/v1beta1/b?alt=json returned "Forbidden">
Can you try commenting out the try: and except: around line 45 of
apiclient.errors.py and see why the JSON isn't being parsed?
Original comment by jcgregorio@google.com
on 25 Jul 2012 at 4:12
That try statement doesn't get executed in the batch case. For some reason my
batch requests yield a capitalized 'Content-Type' header, so it doesn't pass
this if statement
if self.resp.get('content-type', '').startswith('application/json'):
Original comment by yova...@google.com
on 25 Jul 2012 at 4:17
This issue was closed by revision 21b17d8feb57.
Original comment by jcgregorio@google.com
on 26 Jul 2012 at 2:02
Ah, that's fundamentally a bug in httplib2, which I just committed a fix for,
but I have also worked around that issue and make the parsing code more robust
in this change:
http://codereview.appspot.com/6447045/
Original comment by jcgregorio@google.com
on 26 Jul 2012 at 2:31
That did the trick; thanks.
Original comment by yova...@google.com
on 27 Jul 2012 at 4:16
Original issue reported on code.google.com by
yova...@google.com
on 24 Jul 2012 at 12:15Attachments: