Skip to content
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

Remove raise_for_status, because it will prevent catching 404s. #182

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

Thijsvandepoll
Copy link
Contributor

The response.raise_for_status() method raises HTTP exceptions for status codes. The Elasticsearch client relies for some functionality on HEAD requests to check whether resources exist. This is needed for (e.g.):

  • client.indices.exists()
  • client.get()

Raising the 404 error code as an HTTP exception will fail all downstream functionality. Not raising it as an HTTP exception should make it consistent again with how the Elasticsearch client is expecting the responses again. See #174 for more details.

Copy link

cla-checker-service bot commented Aug 6, 2024

💚 CLA has been signed

@miguelgrinberg
Copy link
Contributor

@Thijsvandepoll we need a signed CLA before we can commit this change.

@Thijsvandepoll
Copy link
Contributor Author

I did sign it. What should I do with it?

@miguelgrinberg miguelgrinberg merged commit 577375f into elastic:main Aug 7, 2024
10 checks passed
@miguelgrinberg
Copy link
Contributor

@Thijsvandepoll That's it, thanks! We'll be releasing 8.15 in the next few days, so this change will be available soon.

github-actions bot pushed a commit that referenced this pull request Aug 7, 2024
miguelgrinberg pushed a commit that referenced this pull request Aug 7, 2024
…EAD requests (#182) (#183)

(cherry picked from commit 577375f)

Co-authored-by: Thijsvandepoll <43474152+Thijsvandepoll@users.noreply.github.com>
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