Skip to content

fix(cdk): Improve HTTP 400 error message (AI-Triage PR)#943

Closed
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1773119005-improve-400-error-message
Closed

fix(cdk): Improve HTTP 400 error message (AI-Triage PR)#943
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1773119005-improve-400-error-message

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

fix(cdk): Improve HTTP 400 error message (AI-Triage PR)

Summary

Improves the default HTTP 400 error message in DEFAULT_ERROR_MAPPING to comply with Airbyte's error message guidelines.

Before: "HTTP Status Code: 400. Error: Bad request. Please check your request parameters."
After: "Bad request response from source API."

The old message violated several guidelines:

  • Contained remediation language ("Please check your request parameters")
  • Included redundant implementation detail ("HTTP Status Code: 400")
  • Was vague and not actionable for users

The new message is concise, deterministic, and follows the <Subject> <violated_condition> [qualifier]. format.

This change affects all HTTP-based source connectors that rely on the CDK's default error mapping for 400 responses. Connectors with custom error handlers are unaffected.

Related to https://github.com/airbytehq/airbyte-internal-issues/issues/15970

Review & Testing Checklist for Human

  • Cross-repo string references: Verify that no connectors or tests in airbytehq/airbyte or other repos assert on the exact old string "HTTP Status Code: 400. Error: Bad request. Please check your request parameters.". A grep across the monorepo is recommended.
  • Message wording: Confirm the new message "Bad request response from source API." is clear and appropriate as a generic default for all source connectors encountering HTTP 400.
  • FailureType classification: The system_error type is preserved. Consider whether this is the best default for 400 responses (which can indicate either a connector bug or a user config issue depending on context).

Notes

  • Prior art: airbytehq/airbyte-python-cdk#918 by Patrick Nilan (@pnilan) proposed a broader overhaul of all HTTP error messages but was closed with CI failures. This PR takes a focused approach, changing only the 400 message that was specifically called out in the tracking issue.
  • The FailureType and ResponseAction are intentionally left unchanged to keep this PR minimal and low-risk.

Requested by: bot_apk
Devin session

Remove vague remediation language ('Please check your request parameters')
and redundant HTTP status code prefix from the default 400 error message.

New message follows error message guidelines:
- No remediation/please language
- Concise and specific
- Under 120 characters
- Deterministic

Related to airbytehq/airbyte-internal-issues#15970

Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
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
Copy Markdown

👋 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/1773119005-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/1773119005-improve-400-error-message

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
Copy Markdown

PyTest Results (Fast)

3 892 tests  ±0   3 880 ✅ ±0   6m 52s ⏱️ +6s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 477787d. ± Comparison against base commit f550424.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
unit_tests.sources.declarative.requesters.error_handlers.test_default_error_handler ‑ test_default_error_handler_with_custom_response_filter[_with_http_response_status_400_fail_with_default_failure_type-400-test_response_filter0-ResponseAction.RETRY-FailureType.system_error-HTTP Status Code: 400. Error: Bad request. Please check your request parameters.]
unit_tests.sources.declarative.requesters.error_handlers.test_default_error_handler ‑ test_default_error_handler_with_custom_response_filter[_with_http_response_status_400_fail_with_default_failure_type-400-test_response_filter0-ResponseAction.RETRY-FailureType.system_error-Bad request response from source API.]

@github-actions
Copy link
Copy Markdown

PyTest Results (Full)

3 895 tests  ±0   3 883 ✅ ±0   11m 33s ⏱️ +19s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 477787d. ± Comparison against base commit f550424.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
unit_tests.sources.declarative.requesters.error_handlers.test_default_error_handler ‑ test_default_error_handler_with_custom_response_filter[_with_http_response_status_400_fail_with_default_failure_type-400-test_response_filter0-ResponseAction.RETRY-FailureType.system_error-HTTP Status Code: 400. Error: Bad request. Please check your request parameters.]
unit_tests.sources.declarative.requesters.error_handlers.test_default_error_handler ‑ test_default_error_handler_with_custom_response_filter[_with_http_response_status_400_fail_with_default_failure_type-400-test_response_filter0-ResponseAction.RETRY-FailureType.system_error-Bad request response from source API.]

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