@@ -264,9 +264,9 @@ def _raw_get(self, path, content_type=None, **kwargs):
264
264
headers = headers ,
265
265
verify = self .ssl_verify ,
266
266
timeout = self .timeout )
267
- except Exception :
267
+ except Exception as e :
268
268
raise GitlabConnectionError (
269
- "Can't connect to GitLab server (%s)" % self . _url )
269
+ "Can't connect to GitLab server (%s)" % e )
270
270
271
271
def _raw_post (self , path , data = None , content_type = None , ** kwargs ):
272
272
url = '%s%s' % (self ._url , path )
@@ -276,9 +276,9 @@ def _raw_post(self, path, data=None, content_type=None, **kwargs):
276
276
headers = headers ,
277
277
verify = self .ssl_verify ,
278
278
timeout = self .timeout )
279
- except Exception :
279
+ except Exception as e :
280
280
raise GitlabConnectionError (
281
- "Can't connect to GitLab server (%s)" % self . _url )
281
+ "Can't connect to GitLab server (%s)" % e )
282
282
283
283
def _raw_put (self , path , data = None , content_type = None , ** kwargs ):
284
284
url = '%s%s' % (self ._url , path )
@@ -289,9 +289,9 @@ def _raw_put(self, path, data=None, content_type=None, **kwargs):
289
289
headers = headers ,
290
290
verify = self .ssl_verify ,
291
291
timeout = self .timeout )
292
- except Exception :
292
+ except Exception as e :
293
293
raise GitlabConnectionError (
294
- "Can't connect to GitLab server (%s)" % self . _url )
294
+ "Can't connect to GitLab server (%s)" % e )
295
295
296
296
def _raw_delete (self , path , content_type = None , ** kwargs ):
297
297
url = '%s%s' % (self ._url , path )
@@ -303,9 +303,9 @@ def _raw_delete(self, path, content_type=None, **kwargs):
303
303
headers = headers ,
304
304
verify = self .ssl_verify ,
305
305
timeout = self .timeout )
306
- except Exception :
306
+ except Exception as e :
307
307
raise GitlabConnectionError (
308
- "Can't connect to GitLab server (%s)" % self . _url )
308
+ "Can't connect to GitLab server (%s)" % e )
309
309
310
310
def list (self , obj_class , ** kwargs ):
311
311
"""Request the listing of GitLab resources.
@@ -343,9 +343,9 @@ def list(self, obj_class, **kwargs):
343
343
r = requests .get (url , params = params , headers = headers ,
344
344
verify = self .ssl_verify ,
345
345
timeout = self .timeout )
346
- except Exception :
346
+ except Exception as e :
347
347
raise GitlabConnectionError (
348
- "Can't connect to GitLab server (%s)" % self . _url )
348
+ "Can't connect to GitLab server (%s)" % e )
349
349
350
350
raise_error_from_response (r , GitlabListError )
351
351
@@ -413,9 +413,9 @@ def get(self, obj_class, id=None, **kwargs):
413
413
try :
414
414
r = requests .get (url , params = params , headers = headers ,
415
415
verify = self .ssl_verify , timeout = self .timeout )
416
- except Exception :
416
+ except Exception as e :
417
417
raise GitlabConnectionError (
418
- "Can't connect to GitLab server (%s)" % self . _url )
418
+ "Can't connect to GitLab server (%s)" % e )
419
419
420
420
raise_error_from_response (r , GitlabGetError )
421
421
return r .json ()
@@ -469,9 +469,9 @@ def delete(self, obj, id=None, **kwargs):
469
469
headers = headers ,
470
470
verify = self .ssl_verify ,
471
471
timeout = self .timeout )
472
- except Exception :
472
+ except Exception as e :
473
473
raise GitlabConnectionError (
474
- "Can't connect to GitLab server (%s)" % self . _url )
474
+ "Can't connect to GitLab server (%s)" % e )
475
475
476
476
raise_error_from_response (r , GitlabDeleteError )
477
477
return True
@@ -516,9 +516,9 @@ def create(self, obj, **kwargs):
516
516
headers = headers ,
517
517
verify = self .ssl_verify ,
518
518
timeout = self .timeout )
519
- except Exception :
519
+ except Exception as e :
520
520
raise GitlabConnectionError (
521
- "Can't connect to GitLab server (%s)" % self . _url )
521
+ "Can't connect to GitLab server (%s)" % e )
522
522
523
523
raise_error_from_response (r , GitlabCreateError , 201 )
524
524
return r .json ()
@@ -562,9 +562,9 @@ def update(self, obj, **kwargs):
562
562
headers = headers ,
563
563
verify = self .ssl_verify ,
564
564
timeout = self .timeout )
565
- except Exception :
565
+ except Exception as e :
566
566
raise GitlabConnectionError (
567
- "Can't connect to GitLab server (%s)" % self . _url )
567
+ "Can't connect to GitLab server (%s)" % e )
568
568
569
569
raise_error_from_response (r , GitlabUpdateError )
570
570
return r .json ()
0 commit comments