Skip to content

Commit

Permalink
Merge branch 'main' into fix/pydantic-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanie0x00 authored Sep 19, 2024
2 parents a7f8006 + 4539117 commit d678df3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions boefjes/boefjes/docker_boefjes_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def run(self) -> None:
# have to raise exception to prevent _start_working function from setting status to completed
raise RuntimeError("Boefje did not call output API endpoint")
except ContainerError as e:
logger.exception("Container error")
logger.error(
"Container for task %s failed and returned exit status %d, stderr saved to bytes",
task_id,
e.exit_status,
)

# save container log (stderr) to bytes
self.bytes_api_client.login()
Expand All @@ -74,9 +78,9 @@ def run(self) -> None:
logger.error("Failed to save boefje meta to bytes, continuing anyway")
self.bytes_api_client.save_raw(task_id, e.stderr, stderr_mime_types)
self.scheduler_client.patch_task(task_id, TaskStatus.FAILED)
# have to raise exception to prevent _start_working function from setting status to completed
raise e
except (APIError, ImageNotFound) as e:
logger.exception("API error or image not found")
except ImageNotFound:
logger.error("Docker image %s not found", self.boefje_resource.oci_image)
self.scheduler_client.patch_task(task_id, TaskStatus.FAILED)
except APIError as e:
logger.error("Docker API error: %s", e)
self.scheduler_client.patch_task(task_id, TaskStatus.FAILED)
raise e

0 comments on commit d678df3

Please sign in to comment.