Skip to content

Commit 7cc3fae

Browse files
author
Justin Merrell
committed
fix: catching more errors
1 parent 596cb2a commit 7cc3fae

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

runpod/serverless/modules/job.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ def get(worker_id):
4141
log(f"TAKE_JOB URL response: {assigned_job.status_code}")
4242
get_return = assigned_job.json()
4343

44+
# Status code 400
45+
except requests.exceptions.HTTPError:
46+
log("HTTPError while requesting job", 'WARNING')
47+
48+
# Status code 408
4449
except requests.exceptions.Timeout:
4550
log("Timeout while requesting job", 'WARNING')
4651

@@ -113,6 +118,12 @@ def post(worker_id, job_id, job_output):
113118

114119
try:
115120
rp_session.post(job_done_url, data=job_data, headers=headers, timeout=10)
121+
122+
# Status code 400
123+
except requests.exceptions.HTTPError:
124+
log(f"HTTPError while completing job {job_id}")
125+
126+
# Status code 408
116127
except requests.exceptions.Timeout:
117128
log(f"Timeout while completing job {job_id}")
118129

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = runpod
3-
version = 0.6.2
3+
version = 0.6.3
44
description = Official Python library for RunPod API & SDK.
55
long_description = file: README.md
66
long_description_content_type = text/markdown

0 commit comments

Comments
 (0)