-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Update InferenceException to retain top-level message #126345
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
Conversation
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Pinging @elastic/search-eng (Team:SearchOrg) |
Pinging @elastic/search-relevance (Team:Search - Relevance) |
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.
LGTM
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.
LGTM
public RestStatus status() { | ||
// Override status so that we get the status of the cause while retaining the message of the inference exception when emitting to | ||
// XContent | ||
return ExceptionsHelper.status(getCause()); |
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.
Nice cleanup! 👍
Updates
InferenceException
to retain the top-level message when converted to XContent. The purpose ofInferenceException
is to pass through the status of the cause while retaining the top-level message for better error traceability, which it wasn't doing before.With this change, an
InferenceException
emitted to XContent looks like: