fix(cdk): Remove remediation language from generic 400 error message (AI-Triage PR)#944
Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Draft
Conversation
The default 400 error message contained 'Please check your request
parameters' which violates the writing-good-error-messages guidelines:
- Embeds remediation language ('Please check...')
- Redundantly prefixes with 'HTTP Status Code: 400. Error:'
- Not specific enough to be actionable
Simplified to 'Bad request.' which is concise and does not embed
unhelpful remediation suggestions. Connectors should use
HttpResponseFilter with custom error_message templates to provide
API-specific context for 400 errors.
Related to airbytehq/airbyte-internal-issues#15976
Related to airbytehq/oncall#11577
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou 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/1773146540-improve-400-error-message#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/1773146540-improve-400-error-messagePR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
PyTest Results (Fast)3 892 tests ±0 3 880 ✅ ±0 6m 49s ⏱️ +3s Results for commit fdf7a58. ± Comparison against base commit f550424. This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both. |
PyTest Results (Full)3 895 tests ±0 3 883 ✅ ±0 11m 13s ⏱️ -1s Results for commit fdf7a58. ± Comparison against base commit f550424. This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both. |
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.
fix(cdk): Remove remediation language from generic 400 error message (AI-Triage PR)
Summary
Simplifies the CDK's default 400 error message from
"HTTP Status Code: 400. Error: Bad request. Please check your request parameters."to"Bad request.".The old message violated error message guidelines:
This is the generic fallback for any connector that doesn't define a custom
HttpResponseFilterfor 400 responses. Connectors that need API-specific context should add their ownHttpResponseFilterwith interpolated error messages (e.g.,{{ response.message }}).Related to https://github.com/airbytehq/airbyte-internal-issues/issues/15976
Related to https://github.com/airbytehq/oncall/issues/11577
Review & Testing Checklist for Human
"Bad request. The server rejected the request."would be better, or whether brevity is preferred since connectors should override this with specific messages viaHttpResponseFilter.system_error— a 400 is often aconfig_error(bad user-provided parameters). This PR does not change the classification. Verify this is intentional / acceptable to defer.default_error_mapping.py(e.g., 403, 429) still use the"HTTP Status Code: X. Error: ..."pattern. Confirm whether this inconsistency is acceptable or if a broader cleanup is expected.Notes
HttpResponseFiltertosource-paypal-transaction'slist_disputesstream) is tracked separately.Requested by: bot_apk
Devin session