-
Notifications
You must be signed in to change notification settings - Fork 182
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
FIX: catch 401 and 403 status and return proper error message #495
FIX: catch 401 and 403 status and return proper error message #495
Conversation
Signed-off-by: George Chen <[email protected]>
Signed-off-by: George Chen <[email protected]>
aec3f73
to
20490fc
Compare
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 good, needs tests.
java-client/src/main/java/org/opensearch/client/transport/rest_client/RestClientTransport.java
Outdated
Show resolved
Hide resolved
Signed-off-by: George Chen <[email protected]>
Signed-off-by: George Chen <[email protected]>
Signed-off-by: George Chen <[email protected]>
ce911c8
to
ddf378b
Compare
...lient/src/test/java/org/opensearch/client/transport/rest_client/RestClientTransportTest.java
Outdated
Show resolved
Hide resolved
java-client/src/main/java/org/opensearch/client/transport/rest_client/RestClientTransport.java
Outdated
Show resolved
Hide resolved
java-client/src/main/java/org/opensearch/client/transport/rest_client/RestClientTransport.java
Outdated
Show resolved
Hide resolved
Signed-off-by: George Chen <[email protected]>
java-client/src/main/java/org/opensearch/client/transport/rest_client/RestClientTransport.java
Show resolved
Hide resolved
Signed-off-by: George Chen <[email protected]>
Signed-off-by: George Chen <[email protected]>
d7d4dbb
to
b834c4d
Compare
// The security plugin is required | ||
Assume.assumeThat(isHttps(), equalTo(true)); | ||
|
||
final String userName = Optional.ofNullable(System.getProperty("user")).orElse("admin"); |
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 think you don't even need credentialsProvider
here
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.
@reta you good with this?
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-495-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 004bb9595f21ecccea6914c050513aaad13d6612
# Push it to GitHub
git push --set-upstream origin backport/backport-495-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
@chenqi0805 seems like we need a manual backport to |
@reta Can you help me with manual backport? I got
|
@chenqi0805 It shows that you don't have a local 2.x branch. You can either checkout a 2.x branch on your local or use the branch from upstream. Example:
|
Thanks @VachaShah , @chenqi0805 if you still have difficulties, I could do backport for you, thank you |
Description
This PR fixes the unclear 401 unauthorized exception by catching Json parsing exception.
Issues Resolved
Closes #494
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.