From b5800ee982efa7ab5c9ed8b0b68900a9e5aba20e Mon Sep 17 00:00:00 2001 From: Chris Schrier <schrierc@google.com> Date: Wed, 18 Apr 2012 18:10:50 -0400 Subject: [PATCH] Include PycURL error code in GanetiApiError. Signed-off-by: Chris Schrier <schrierc@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/rapi/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rapi/client.py b/lib/rapi/client.py index cbcf9ae75..d68bb621d 100644 --- a/lib/rapi/client.py +++ b/lib/rapi/client.py @@ -472,7 +472,7 @@ class GanetiRapiClient(object): # pylint: disable=R0904 if err.args[0] in _CURL_SSL_CERT_ERRORS: raise CertificateError("SSL certificate error %s" % err) - raise GanetiApiError(str(err)) + raise GanetiApiError(str(err), code=err.args[0]) finally: # Reset settings to not keep references to large objects in memory # between requests -- GitLab