Skip to content

Report a failing app command without the app-runner traceback - #583

Draft
leoschwarz wants to merge 2 commits into
mainfrom
fix/app-command-error-message
Draft

Report a failing app command without the app-runner traceback#583
leoschwarz wants to merge 2 commits into
mainfrom
fix/app-command-error-message

Conversation

@leoschwarz

Copy link
Copy Markdown
Member
  • A failing app command now reports as one Error: Command failed with exit code N: <command> line
    instead of ~10 frames of app-runner traceback stacked under the app's own output.
    BFABRICPY_LOG_LEVEL=DEBUG still shows the traceback.
  • run workunit no longer prints a second traceback when make run-all fails.
  • Nested runner processes (Makefile, SLURM) now log in the normal {level} {message} format at INFO —
    setup_script_logging guarded itself with an env var that children inherited, so they skipped setup
    and fell back to loguru's verbose DEBUG default.
  • Captured uv output is logged one record per line, so every line keeps its level prefix.

Needs a bfabric 1.20.1 release first — the app-runner floor is bumped to >=1.20.1 because the
logging fix lives in bfabric.

Closes #231

🤖 Prepared with assistance from Claude Opus 5 via Claude Code.

…eback

A non-zero app command let subprocess.CalledProcessError escape to the
interpreter's default hook, stacking ~10 frames of app-runner boilerplate
under the app's own error output. Commands now raise CommandFailedError,
a RuntimeError that use_client renders as one Error: line; the traceback
stays available under BFABRICPY_LOG_LEVEL=DEBUG.

Also fixes two presentation bugs found alongside it: setup_script_logging
guarded itself with an inherited env var, so nested runner processes fell
back to loguru's verbose DEBUG default, and captured output was emitted as
one multi-line record leaving all but the first line unprefixed.

Closes #231
`nox -s code_style` runs ruff lint only and CI checks no formatting, so
nothing signals which formatter is authoritative — and `[tool.ruff]`
carrying line-length/indent-width makes `ruff format` look sanctioned.
It disagrees with black on ~15 files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message when app command fails

1 participant