Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: update AirbyteTracedException.__str__ to show user-facing message (AI-Triage PR)#927

Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1772482932-fix-traced-exception-str
Draft

fix: update AirbyteTracedException.__str__ to show user-facing message (AI-Triage PR)#927
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1772482932-fix-traced-exception-str

Conversation

@devin-ai-integration
Copy link
Contributor

fix: update AirbyteTracedException.str to show user-facing message

Summary

Moves the __str__ override from the temporary MessageRepresentationAirbyteTracedErrors subclass into the base AirbyteTracedException class, so that str(exception) returns the user-facing message globally (falling back to internal_message if message is not set).

The subclass MessageRepresentationAirbyteTracedErrors in http_client.py was an acknowledged workaround — its own docstring stated this behavior should eventually be promoted to the base class. This PR completes that migration.

Changes:

  • airbyte_cdk/utils/traced_exception.py: Add __str__ that returns self.messageself.internal_message""
  • airbyte_cdk/sources/streams/http/http_client.py: Remove MessageRepresentationAirbyteTracedErrors class; update two raise sites to use AirbyteTracedException directly

Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/15916:

Review & Testing Checklist for Human

  • Blast radius of global __str__ change: This changes behavior for every AirbyteTracedException subclass across the CDK, not just the two sites in http_client.py. Search for str(e), f"{e}", and logging calls that stringify caught AirbyteTracedException instances to verify no critical debug info is lost in logs or error tracking.
  • Inconsistency with super().__init__(internal_message): The constructor still passes internal_message to Exception.__init__, so exception.args[0] remains internal_message while str(exception) now returns message. Confirm this mismatch doesn't break anything (e.g., traceback formatting, Sentry grouping).
  • No new unit test for __str__ behavior: Existing tests pass because they only set internal_message (hitting the fallback path). Consider adding an explicit test where both message and internal_message are set to verify str() returns message.

Suggested test plan: Run the full CDK test suite (poetry run poe pytest-fast). Additionally, grep the codebase for str( patterns on AirbyteTracedException and its subclasses to manually verify the behavioral change is safe.

Notes

Move the __str__ override from the MessageRepresentationAirbyteTracedErrors
subclass into the base AirbyteTracedException class so that str(exception)
returns the user-facing message globally, falling back to internal_message.

Remove the now-unnecessary MessageRepresentationAirbyteTracedErrors subclass
and update the two raise sites in HttpClient to use AirbyteTracedException
directly.

Co-Authored-By: bot_apk <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This CDK Version

You can test this version of the CDK using the following:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1772482932-fix-traced-exception-str#egg=airbyte-python-cdk[dev]' --help

# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1772482932-fix-traced-exception-str

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

PyTest Results (Fast)

3 869 tests  ±0   3 857 ✅ ±0   6m 21s ⏱️ -30s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 07d84bc. ± Comparison against base commit 7f41401.

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

PyTest Results (Full)

3 872 tests   3 860 ✅  11m 19s ⏱️
    1 suites     12 💤
    1 files        0 ❌

Results for commit 07d84bc.

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.

0 participants