-
Notifications
You must be signed in to change notification settings - Fork 194
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
Feature/get missing alias json exception 301 #399
Feature/get missing alias json exception 301 #399
Conversation
…opensearch-project#301) Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>
…mpleEndpoint request (opensearch-project#301) Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>
Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>
…er (opensearch-project#301) Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK to me. Made some smallish suggestions.
Should we open an issue in OpenSearch to not return a different response format in 3.0? This seems like an odd choice server-side. Are there other places where the server does this?
java-client/src/main/java/org/opensearch/client/opensearch/_types/ErrorStringResponse.java
Outdated
Show resolved
Hide resolved
java-client/src/main/java/org/opensearch/client/opensearch/_types/ErrorStringResponse.java
Outdated
Show resolved
Hide resolved
java-client/src/main/java/org/opensearch/client/transport/endpoints/SimpleEndpoint.java
Show resolved
Hide resolved
...client/src/main/java/org/opensearch/client/opensearch/_types/OpenSearchExceptionFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>
I think yes, it seems it is only one case: Lines: [160, 162] Thanks for the review :) |
Will you please do it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some nitpicky asks, the only must have is the license header update, we don't need the "modifications ..." part.
I think the rest of the code uses two spaces instead of 4/tabs? Mind checking and matching that. We should have some style checker/autoformatter do this and fail CI otherwise, too.
java-client/src/main/java/org/opensearch/client/opensearch/_types/ErrorStringResponse.java
Outdated
Show resolved
Hide resolved
java-client/src/main/java/org/opensearch/client/opensearch/_types/ErrorStringResponse.java
Outdated
Show resolved
Hide resolved
java-client/src/main/java/org/opensearch/client/opensearch/_types/ErrorStringResponse.java
Outdated
Show resolved
Hide resolved
...client/src/main/java/org/opensearch/client/opensearch/_types/OpenSearchExceptionFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>
Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>
The tests are using 4 spaces. |
|
Re-running flaky tests. Someone should look at those, wink wink :) |
There is a fix suggested already #421 |
@reta I just merged that. Shall we just merge this one? |
@dblock the main is broken now (after opensearch-project/OpenSearch#6875), fixing it now |
Hi @szczepanczykd, apologies for the delay! Can you merge the latest changes from main and fix the conflicts? We can get this merged once the CI is green. |
Hi :)
Sure, I will do it today, around 18 UTC.
…On Fri, 5 May 2023, 07:57 Vacha Shah, ***@***.***> wrote:
Hi @szczepanczykd <https://github.com/szczepanczykd>, apologies for the
delay! Can you merge the latest changes from main and fix the conflicts? We
can get this merged once the CI is green.
—
Reply to this email directly, view it on GitHub
<#399 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALVQM4MRLPGFIZZGFMGDCSLXESJDBANCNFSM6AAAAAAVS7U6UA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>
@VachaShah done :) |
@dblock @szczepanczykd @VachaShah I think this change is good but it does not follow the way we manage such API elements (when multiple forms are possible). Generally, it is done as a union (see for example https://github.com/opensearch-project/opensearch-java/blob/main/java-client/src/main/java/org/opensearch/client/opensearch/_types/Script.java#L164 but there are much more). The way I would see it working is:
WDYT? |
Sounds good.
Let's try it.
…On Fri, 5 May 2023, 20:16 Andriy Redko, ***@***.***> wrote:
@dblock <https://github.com/dblock> @szczepanczykd
<https://github.com/szczepanczykd> @VachaShah
<https://github.com/VachaShah> I think this change is good but it does
not follow the way we manage such API elements (when multiple forms are
possible). Generally, it is done as a union (see for example
https://github.com/opensearch-project/opensearch-java/blob/main/java-client/src/main/java/org/opensearch/client/opensearch/_types/Script.java#L164
but there are much more).
The way I would see it working is:
- in both cases, the error is the same class ErrorResponse
- but depending on the type (Object or String - solved by
UnionDeserializer), it is either a full one or just ErrorCause with
message populated
WDYT?
—
Reply to this email directly, view it on GitHub
<#399 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALVQM4N2F6HOUDM6GYZ2U5LXEU7ZVANCNFSM6AAAAAAVS7U6UA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@VachaShah @reta |
Done in: #476 |
Description
Handling String error response from /_alias/not_existing_alias endpoint.
Add errorDeserializer to SimpleEndpoint constructor -> and use ErrorResponse._DESERIALIZER in every instance (except the GetAliasRequest._ENDPOINT) -> maybe two constructors would be better (one with default errorDeserializer)?
Created OpenSearchExceptionFactory -> thrown OpenSearchException is untouched.
API error response for GET https://localhost:9200/_alias/not_existing_alias (ErrorStringResponse format)
API error response for GET https://localhost:9200/not_existing_index/_search (ErrorResponse format)
Issues Resolved
#301
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.