Skip to content

Commit

Permalink
[ci] Tolerate duplicates when registering version (#7281)
Browse files Browse the repository at this point in the history
Issue: #

### Brief Summary
  • Loading branch information
feisuzhu authored and lin-hitonami committed Feb 2, 2023
1 parent 4b0e00c commit e67c674
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions misc/save_new_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@
json=payload,
auth=(username, password),
timeout=5)
r = response.json()
print(r)
response.raise_for_status()
except requests.exceptions.ConnectionError as err:
print('Updating latest version failed: No internet,', err)
exit(1)
except requests.exceptions.HTTPError as err:
if 'duplicate' in r['message']:
exit(0)
print('Updating latest version failed: Server error,', err)
exit(1)
except requests.exceptions.Timeout as err:
Expand All @@ -43,5 +47,4 @@
print('Updating latest version failed:', err)
exit(1)

response = response.json()
print(response['message'])
exit(0)

0 comments on commit e67c674

Please sign in to comment.