Skip to content

Surface caused_by in ApiError #2932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 18, 2025
Merged

Conversation

pquentin
Copy link
Member

In particular, this will give a clear error when using elasticsearch-py 9.0.0 on an 8.x clusters. Which helps with issues likes #2927 and #2923.

Before:

elasticsearch.BadRequestError: BadRequestError(400, 'media_type_header_exception', 'Invalid media-type value on headers [Accept, Content-Type]')

After:

elasticsearch.BadRequestError: BadRequestError(400, 'media_type_header_exception', 'Invalid media-type value on headers [Accept, Content-Type]', Accept version must be either version 8 or 7, but found 9. Accept=application/vnd.elasticsearch+json; compatible-with=9)

In particular, this will give a clear error when using elasticsearch-py 9.0.0
on an 8.x clusters.
@pquentin pquentin requested a review from miguelgrinberg April 17, 2025 13:32
@pquentin pquentin merged commit 72efd52 into elastic:main Apr 18, 2025
15 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 18, 2025
In particular, this will give a clear error when using elasticsearch-py 9.0.0
on an 8.x cluster.

(cherry picked from commit 72efd52)
github-actions bot pushed a commit that referenced this pull request Apr 18, 2025
In particular, this will give a clear error when using elasticsearch-py 9.0.0
on an 8.x cluster.

(cherry picked from commit 72efd52)
pquentin added a commit that referenced this pull request Apr 18, 2025
In particular, this will give a clear error when using elasticsearch-py 9.0.0
on an 8.x cluster.

(cherry picked from commit 72efd52)

Co-authored-by: Quentin Pradet <[email protected]>
pquentin added a commit that referenced this pull request Apr 18, 2025
In particular, this will give a clear error when using elasticsearch-py 9.0.0
on an 8.x cluster.

(cherry picked from commit 72efd52)

Co-authored-by: Quentin Pradet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants