Skip to content

Commit 9c98fe4

Browse files
authored
client: Fix error when a RequestException has no status_code
It's not available for instance for the following RequestException: ConnectionError(ProtocolError('Connection aborted.', error("(104, 'ECONNRESET')",)),)
1 parent f64266c commit 9c98fe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_auth_gitlab/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def _request(self, path, access_token):
2222
try:
2323
req = http.get(url, headers=headers)
2424
except RequestException as e:
25-
raise GitLabApiError(unicode(e), status=e.status_code)
25+
raise GitLabApiError(unicode(e), status=getattr(e, 'status_code', None))
2626
return json.loads(req.content)
2727

2828
def get_user(self, access_token):

0 commit comments

Comments
 (0)