Skip to content

Commit 842e442

Browse files
author
bspkrs
committed
wrap requests.put() in try/catch
1 parent c05bbdc commit 842e442

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: MavenHandler.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ def upload(cls, maven_url, maven_user, maven_pass, artifact_name, local_path='',
5151

5252

5353
@classmethod
54-
def do_put(cls, url, auth, data, retry_count=0):
55-
r = requests.put(url, auth=auth, data=data)
54+
def do_put(cls, url, auth, data, logger=None):
55+
try:
56+
r = requests.put(url, auth=auth, data=data)
57+
except requests.ConnectTimeout as e:
58+
return e.response.status_code
5659
return r.status_code
5760

5861

0 commit comments

Comments
 (0)