fix: report output format failures as usage errors - #363
codeforester wants to merge 2 commits into
Conversation
| _emit_json_error(state, outcome, str(exc), output_capture) | ||
| return outcome.exit_code | ||
| raise | ||
| except OutputFormatError as exc: |
There was a problem hiding this comment.
Consistency: the new except OutputFormatError branch never checks reraise_unexpected, unlike every other exception branch in run_app() that offers it as a debugging/testing escape hatch (e.g. base_cli.testing.invoke(app, args, reraise_unexpected=True)). Callers relying on that pattern to inspect the raw exception/traceback can't do so for this new error path.
|
Additional finding (file not touched by this diff, so not postable as an inline comment):
|
Summary
output_format_errorin JSON mode.Closes #343
Validation
uv run --extra dev --extra typer --extra quality python -m pytest tests/test_optional_yaml_dependency.py tests/test_json_contracts.py -qgit diff --check