Open
Description
What to change
ErrorMessageFactory
ErrorMessage
OpenSearchErrorMessage
Reason
- Those classes are duplicated - in
:legacy
for SQL and in:opensearch
for PPL. - They are referred in two places:
- in
ResponseFormatter
s in:protocol
to format an exception, but this code never used - in
RestPPLQueryAction
in:plugin
to format a error for PPL and inRestSqlAction
in:legacy
to format a error in SQL
- in
- These classes add a dependency between
:protocol
and:opensearch
.
Purpose
- Break the dependency - this is needed for [FEATURE] Make OpenSearch function registered dynamically #811 (UDF = user defined functions)
- Use formatters to format an exception
How to
- Let
OpenSearchExecutionEngine
to extract data fromOpenSearchErrorMessage
and build a regular exception. - Move
ErrorMessage
to:protocol
. - Delete
ErrorMessageFactory
since it is not needed anymore; copyunwrapCause
toErrorMessage
. - See example in e66e6b9.