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

Commite35563e

Browse files
author
Gauvain Pocentek
committed
Exceptions: use a proper error message
1 parente09581f commite35563e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎gitlab/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,18 @@ def sanitized_url(url):
685685
if200<=result.status_code<300:
686686
returnresult
687687

688+
try:
689+
error_message=result.json()['message']
690+
exceptExceptionase:
691+
error_message=result.content
692+
688693
ifresult.status_code==401:
689694
raiseGitlabAuthenticationError(response_code=result.status_code,
690-
error_message=result.content,
695+
error_message=error_message,
691696
response_body=result.content)
692697

693698
raiseGitlabHttpError(response_code=result.status_code,
694-
error_message=result.content,
699+
error_message=error_message,
695700
response_body=result.content)
696701

697702
defhttp_get(self,path,query_data={},streamed=False,**kwargs):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp