RAPI client should convert urllib2.URLError to GanetiApiError
authorTom Limoncelli <tlim@google.com>
Mon, 31 May 2010 17:09:00 +0000 (13:09 -0400)
committerMichael Hanselmann <hansmi@google.com>
Mon, 31 May 2010 17:17:30 +0000 (19:17 +0200)
Signed-off-by: Tom Limoncelli <tlim@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/rapi/client.py

index 262e389..38f673b 100644 (file)
@@ -421,6 +421,8 @@ class GanetiRapiClient(object):
       raise CertificateError("SSL issue: %s (%r)" % (err, err))
     except urllib2.HTTPError, err:
       raise GanetiApiError(str(err), code=err.code)
+    except urllib2.URLError, err:
+      raise GanetiApiError(str(err))
 
     if encoded_response_content:
       response_content = simplejson.loads(encoded_response_content)