Repository navigation
fix: classify_error falls back to exception type name when message is blank - #5
Merged
Merged
Conversation
… blank A bare exception (e.g. a ProxyClient redeem call to the broker's /v1/credentials/servicex/redeem exceeding its 10s timeout) has an empty str(exc), which classify_error() propagated verbatim into "Error: \n\n**Recovery:** ...", giving operators no clue what actually failed. Fall back to the exception type name so every read-only tool error at least names the failure class. Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Error: \n\n**Recovery:** ...message with no indication of what actually failed.classify_error()buildsf"Error: {exc_msg}\n\n**Recovery:** {guidance}"fromexc_msg = str(exc). Some exceptions we hit in practice — notably a bare timeout fromProxyClient.access_token()(10s hardcoded timeout inaf_credentials/proxy.pycalling the broker'sPOST /v1/credentials/servicex/redeem) — have an emptystr(exc), so the message collapsed to nothing.str(exc)is empty, so the caller always sees something (Error: TimeoutErrorinstead ofError:).Test plan
TestClassifyError::test_blank_message_falls_back_to_exception_type_nameandtest_other_category_blank_message_falls_back_to_exception_type_name, confirmed both fail against the old code and pass against the fix (TDD).pixi run -e py312 pytest -m "not slow"— 299 passed.prek run --files src/servicex_mcp/tools/_helpers.py tests/test_helpers.py— all hooks (ruff, mypy, codespell, etc.) passed.🤖 Generated with Claude Code