Skip to content

Commit 646aa33

Browse files
committed
Improve question mark error message
1 parent 3ba0c19 commit 646aa33

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

compute_worker/compute_worker.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,31 @@ def run_wrapper(run_args):
259259
if run.is_scoring:
260260
run.push_scores()
261261
run.push_output()
262-
except (DockerImagePullException, SubmissionException, SoftTimeLimitExceeded) as e:
263-
run._update_status(STATUS_FAILED, traceback.format_exc())
262+
except DockerImagePullException as e:
263+
msg = str(e).strip()
264+
if msg:
265+
msg = f"Docker image pull failed: {msg}"
266+
else:
267+
msg = "Docker image pull failed."
268+
run._update_status(STATUS_FAILED, extra_information=msg)
269+
raise
270+
except SoftTimeLimitExceeded:
271+
run._update_status(
272+
STATUS_FAILED,
273+
extra_information="Execution time limit exceeded.",
274+
)
275+
raise
276+
except SubmissionException as e:
277+
msg = str(e).strip()
278+
if msg:
279+
msg = f"Submission failed: {msg}. See logs for more details."
280+
else:
281+
msg = "Submission failed. See logs for more details."
282+
run._update_status(STATUS_FAILED, extra_information=msg)
264283
raise
265284
except Exception as e:
266285
# Catch any exception to avoid getting stuck in Running status
267-
run._update_status(STATUS_FAILED, traceback.format_exc())
286+
run._update_status(STATUS_FAILED, extra_information=traceback.format_exc())
268287
raise
269288
finally:
270289
try:

0 commit comments

Comments
 (0)