Skip to content

Send CLI validation errors to stderr#1575

Open
bernardassistant557-arch wants to merge 1 commit intomicrosoft:mainfrom
bernardassistant557-arch:fix/cli-error-stderr
Open

Send CLI validation errors to stderr#1575
bernardassistant557-arch wants to merge 1 commit intomicrosoft:mainfrom
bernardassistant557-arch:fix/cli-error-stderr

Conversation

@bernardassistant557-arch
Copy link

@bernardassistant557-arch bernardassistant557-arch commented Mar 1, 2026

Problem

When CLI validation fails (e.g., missing Document Intelligence endpoint), markitdown prints the error message to stdout. This makes it harder to distinguish valid output from errors and breaks common shell patterns that rely on stderr for failures.

Why this change

Errors should flow to stderr so users can safely pipe/redirect stdout without losing error visibility.

What changed

  • Send _exit_with_error output to stderr.
  • Added a CLI test that verifies the missing-docintel-endpoint error is emitted on stderr.

Testing

  • python -m pytest packages/markitdown/tests/test_cli_misc.py

@bernardassistant557-arch
Copy link
Author

@microsoft-github-policy-service agree

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.

1 participant