Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle urllib HTTPError

  • Loading branch information...
commit df978c4afc5610c3e3810d081e688e7e41a0292b 1 parent 45efa78
@kevinmehall kevinmehall authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  pithos/pandora/pandora.py
View
3  pithos/pandora/pandora.py
@@ -118,6 +118,9 @@ def xmlrpc_call(self, method, args=[], url_args=True, secure=False, includeTime=
req = urllib2.Request(url, data, {'User-agent': USER_AGENT, 'Content-type': 'text/xml'})
response = self.opener.open(req, timeout=HTTP_TIMEOUT)
text = response.read()
+ except urllib2.HTTPError as e:
+ logging.error("HTTP error: %s", e)
+ raise PandoraNetError(str(e))
except urllib2.URLError as e:
logging.error("Network error: %s", e)
if e.reason[0] == 'timed out':
Please sign in to comment.
Something went wrong with that request. Please try again.