Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwenz committed Sep 8, 2023
1 parent 92c54c2 commit 5f8e9df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kservehelper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ def _upload_multithread(webhook_url: str, paths: List[Path], timeout):
def _make_request(filepath):
with open(filepath, "rb") as f:
files = {"file": (filepath, f)}
response = requests.post(webhook_url, files=files, timeout=timeout)
try:
response = requests.post(webhook_url, files=files, timeout=timeout)
except Exception as e:
print(f"ERROR: {e}")
return None
if response.status_code != 200:
return None
r = json.loads(response.text)
Expand Down

0 comments on commit 5f8e9df

Please sign in to comment.