Index: rietveld.py |
diff --git a/rietveld.py b/rietveld.py |
index 2107e2e13ae967f9e5776fa16ca30984f8e1db7f..9adc9c5ca1346a99c79552dc62ae77c17c576871 100644 |
--- a/rietveld.py |
+++ b/rietveld.py |
@@ -416,7 +416,10 @@ class Rietveld(object): |
for retry in xrange(self._maxtries): |
try: |
logging.debug('%s' % request_path) |
- return self.rpc_server.Send(request_path, **kwargs) |
+ result = self.rpc_server.Send(request_path, **kwargs) |
+ # Sometimes GAE returns a HTTP 200 but with HTTP 500 as the content. |
+ # How nice. |
+ return result |
except urllib2.HTTPError, e: |
if retry >= (self._maxtries - 1): |
raise |
@@ -525,11 +528,6 @@ class OAuthRpcServer(object): |
payload: request is a POST if not None, GET otherwise |
timeout: in seconds |
extra_headers: (dict) |
- |
- Returns: the HTTP response body as a string |
- |
- Raises: |
- urllib2.HTTPError |
""" |
# This method signature should match upload.py:AbstractRpcServer.Send() |
method = 'GET' |
@@ -545,6 +543,7 @@ class OAuthRpcServer(object): |
try: |
if timeout: |
self._http.timeout = timeout |
+ # TODO(pgervais) implement some kind of retry mechanism (see upload.py). |
url = self.host + request_path |
if kwargs: |
url += "?" + urllib.urlencode(kwargs) |
@@ -573,10 +572,6 @@ class OAuthRpcServer(object): |
continue |
break |
- if ret[0].status != 200: |
- raise urllib2.HTTPError( |
- request_path, int(ret[0]['status']), ret[1], None, None) |
- |
return ret[1] |
finally: |