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

[BUG] Regression in default exception behavior #250

Open
dblock opened this issue Jan 9, 2025 · 3 comments · May be fixed by #251
Open

[BUG] Regression in default exception behavior #250

dblock opened this issue Jan 9, 2025 · 3 comments · May be fixed by #251
Labels
bug Something isn't working

Comments

@dblock
Copy link
Member

dblock commented Jan 9, 2025

What is the bug?

In #245 we may have flipped the default exception behavior. That should be undone. We also need notes in UPGRADING and a section in the user guide on how to handle errors without exceptions.

What is the expected behavior?

Backwards-compatible behavior in 2.4.0, breaking change in 3.0.

@dblock dblock added the bug Something isn't working label Jan 9, 2025
@dblock dblock removed the untriaged label Jan 9, 2025
@dblock dblock changed the title [BUG] Changed default exception behavior [BUG] Regression in default exception behavior Jan 9, 2025
@kimpepper
Copy link
Contributor

@dblock I went with this approach originally, but since all creation of the 2.3.x Client is made using the ClientBuilder it was better to make the change there. This way we can deprecate the extra constructor arg and remove in 3.x.

@dblock
Copy link
Member Author

dblock commented Jan 9, 2025

@kimpepper Am I misunderstanding and the default with the ClientBuilder is still true? Meaning old code written like so will throw exceptions? (I only want to make sure we don't break semver).

$client = (new \OpenSearch\ClientBuilder())
   ->setHosts([getenv("ENDPOINT")])
   ->setSigV4Region(getenv("AWS_REGION"))    
   ->setSigV4CredentialProvider(true)
   ->build();

If this is the case we just need better docs explaining that ClientBuilder doesn't behave like new \OpenSearch\Client, which is a bit odd.

@kimpepper
Copy link
Contributor

Looks like I missed that step. I created #251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants