What is the bug?
Our OpenSearch HTTP Client needs to see the HTTP Response code from OpenSearch to handle various failure scenarios. However, the class : org.opensearch.client.transport.httpclient5.Response is package private, preventing clients from accessing all the details it stores
How can one reproduce the bug?
Steps to reproduce the behavior:
Make a call to openSearch using org.opensearch.client:opensearch-java:2.8.0 client
Simulate an internal server error on Open Search that returns a HTTP 500 error code.
Try to access the error code from the HTTP response, notice how no fields are accessible in the class
What is the expected behavior?
Make org.opensearch.client.transport.httpclient5.Response public so that clients may read details about the error response.
What is your host/environment?
OS: any
Version : any
Plugins : Not applicable
Do you have any screenshots?
Not applicable
Do you have any additional context?
Here is the sample response we received from one of our systems :
Caused by: org.opensearch.client.transport.httpclient5.ResponseException: method [POST], host [https://localhost:9200], URI [/my-query-alias/_search?typed_keys=true&request_cache=false], status line [HTTP/1.1 500 Internal Server Error]
{"error":{"root_cause":[{"type":"security_exception","reason":"Unexpected exception indices:data/read/search"}],"type":"security_exception","reason":"Unexpected exception indices:data/read/search"},"status":500}
What is the bug? Our OpenSearch HTTP Client needs to see the HTTP Response code from OpenSearch to handle various failure scenarios. However, the class : org.opensearch.client.transport.httpclient5.Response is package private, preventing clients from accessing all the details it stores
How can one reproduce the bug? Steps to reproduce the behavior:
What is the expected behavior? Make org.opensearch.client.transport.httpclient5.Response public so that clients may read details about the error response.
What is your host/environment?
Do you have any screenshots? Not applicable
Do you have any additional context? Here is the sample response we received from one of our systems :
Caused by: org.opensearch.client.transport.httpclient5.ResponseException: method [POST], host [https://localhost:9200], URI [/my-query-alias/_search?typed_keys=true&request_cache=false], status line [HTTP/1.1 500 Internal Server Error] {"error":{"root_cause":[{"type":"security_exception","reason":"Unexpected exception indices:data/read/search"}],"type":"security_exception","reason":"Unexpected exception indices:data/read/search"},"status":500}