When calling the APIs like api/assistant/summary, api/assistant/insight and other related APIs, if OpenSearch cluster returns 4xx error, we just return 500 error or 400 error directly, which is not elegant, we should optimize this by checking the status code, if it's 4xx error, we return the original response, and if it's 5xx error, return an general error message.
Issues Resolved
[List any issues this PR will resolve]
Check List
[ ] New functionality includes testing.
[ ] All tests pass, including unit test, integration test.
[ ] New functionality has user manual doc added.
[ ] Commits are signed per the DCO using --signoff.
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.
Description
When calling the APIs like api/assistant/summary, api/assistant/insight and other related APIs, if OpenSearch cluster returns 4xx error, we just return 500 error or 400 error directly, which is not elegant, we should optimize this by checking the status code, if it's 4xx error, we return the original response, and if it's 5xx error, return an general error message.
Issues Resolved
[List any issues this PR will resolve]
Check List
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.