Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08d3ccf

Browse files
author
Gauvain Pocentek
committed
make connection exceptions more explicit
1 parent2eac071 commit08d3ccf

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

‎gitlab/__init__.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ def _raw_get(self, path, content_type=None, **kwargs):
264264
headers=headers,
265265
verify=self.ssl_verify,
266266
timeout=self.timeout)
267-
exceptException:
267+
exceptExceptionase:
268268
raiseGitlabConnectionError(
269-
"Can't connect to GitLab server (%s)"%self._url)
269+
"Can't connect to GitLab server (%s)"%e)
270270

271271
def_raw_post(self,path,data=None,content_type=None,**kwargs):
272272
url='%s%s'% (self._url,path)
@@ -276,9 +276,9 @@ def _raw_post(self, path, data=None, content_type=None, **kwargs):
276276
headers=headers,
277277
verify=self.ssl_verify,
278278
timeout=self.timeout)
279-
exceptException:
279+
exceptExceptionase:
280280
raiseGitlabConnectionError(
281-
"Can't connect to GitLab server (%s)"%self._url)
281+
"Can't connect to GitLab server (%s)"%e)
282282

283283
def_raw_put(self,path,data=None,content_type=None,**kwargs):
284284
url='%s%s'% (self._url,path)
@@ -289,9 +289,9 @@ def _raw_put(self, path, data=None, content_type=None, **kwargs):
289289
headers=headers,
290290
verify=self.ssl_verify,
291291
timeout=self.timeout)
292-
exceptException:
292+
exceptExceptionase:
293293
raiseGitlabConnectionError(
294-
"Can't connect to GitLab server (%s)"%self._url)
294+
"Can't connect to GitLab server (%s)"%e)
295295

296296
def_raw_delete(self,path,content_type=None,**kwargs):
297297
url='%s%s'% (self._url,path)
@@ -303,9 +303,9 @@ def _raw_delete(self, path, content_type=None, **kwargs):
303303
headers=headers,
304304
verify=self.ssl_verify,
305305
timeout=self.timeout)
306-
exceptException:
306+
exceptExceptionase:
307307
raiseGitlabConnectionError(
308-
"Can't connect to GitLab server (%s)"%self._url)
308+
"Can't connect to GitLab server (%s)"%e)
309309

310310
deflist(self,obj_class,**kwargs):
311311
"""Request the listing of GitLab resources.
@@ -343,9 +343,9 @@ def list(self, obj_class, **kwargs):
343343
r=requests.get(url,params=params,headers=headers,
344344
verify=self.ssl_verify,
345345
timeout=self.timeout)
346-
exceptException:
346+
exceptExceptionase:
347347
raiseGitlabConnectionError(
348-
"Can't connect to GitLab server (%s)"%self._url)
348+
"Can't connect to GitLab server (%s)"%e)
349349

350350
raise_error_from_response(r,GitlabListError)
351351

@@ -413,9 +413,9 @@ def get(self, obj_class, id=None, **kwargs):
413413
try:
414414
r=requests.get(url,params=params,headers=headers,
415415
verify=self.ssl_verify,timeout=self.timeout)
416-
exceptException:
416+
exceptExceptionase:
417417
raiseGitlabConnectionError(
418-
"Can't connect to GitLab server (%s)"%self._url)
418+
"Can't connect to GitLab server (%s)"%e)
419419

420420
raise_error_from_response(r,GitlabGetError)
421421
returnr.json()
@@ -469,9 +469,9 @@ def delete(self, obj, id=None, **kwargs):
469469
headers=headers,
470470
verify=self.ssl_verify,
471471
timeout=self.timeout)
472-
exceptException:
472+
exceptExceptionase:
473473
raiseGitlabConnectionError(
474-
"Can't connect to GitLab server (%s)"%self._url)
474+
"Can't connect to GitLab server (%s)"%e)
475475

476476
raise_error_from_response(r,GitlabDeleteError)
477477
returnTrue
@@ -516,9 +516,9 @@ def create(self, obj, **kwargs):
516516
headers=headers,
517517
verify=self.ssl_verify,
518518
timeout=self.timeout)
519-
exceptException:
519+
exceptExceptionase:
520520
raiseGitlabConnectionError(
521-
"Can't connect to GitLab server (%s)"%self._url)
521+
"Can't connect to GitLab server (%s)"%e)
522522

523523
raise_error_from_response(r,GitlabCreateError,201)
524524
returnr.json()
@@ -562,9 +562,9 @@ def update(self, obj, **kwargs):
562562
headers=headers,
563563
verify=self.ssl_verify,
564564
timeout=self.timeout)
565-
exceptException:
565+
exceptExceptionase:
566566
raiseGitlabConnectionError(
567-
"Can't connect to GitLab server (%s)"%self._url)
567+
"Can't connect to GitLab server (%s)"%e)
568568

569569
raise_error_from_response(r,GitlabUpdateError)
570570
returnr.json()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp