opensearch-project / OpenSearch

🔎 Open source distributed and RESTful search engine.
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
9.84k stars 1.83k forks source link

[Feature Request] Regularize and improve error messaging #16558

Open Jon-AtAWS opened 2 weeks ago

Jon-AtAWS commented 2 weeks ago

Is your feature request related to a problem? Please describe

When working with OpenSearch, and facing an issue, I often find the error messages to be insufficient to help me diagnose and correct the issue. This leads to hours of frustrating Googling, that does not always succeed. I have seen complete error mesages with text of "Bad Request" and "Syntax Error".

I especially run into these kinds of situations when trying new code for the first time. This adds a ton of friction for me to use exciting new features in OpenSearch, slowing my adoption of these features.

Describe the solution you'd like

I'd like to see OpenSearch adopt a standard error messaging framework, written as a code module (in each of the repos?) and with a standardized API that requires:

1) Which plugin or core module is throwing the error 2) What was the code doing (a description of the intent of that class/method) when the error occurred 3) What was the error condition, and if possible what caused the error condition 4) [optional] Remediation steps, including links to documentation, links to github repo(s), for syntax errors: the offending character. Something like "did you mean". 5) [optional] list of invalid values (values that broke the API contract) 6) [optional?] the authenticated entity who initiated the request 7) [optional?] any required but missing permissions to execute the request (not action groups! the actual permissions)

Related component

Other

Describe alternatives you've considered

No response

Additional context

No response