-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Search] Error Alignment 2 #80965
[Search] Error Alignment 2 #80965
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
It's better to use a title that describes the error. Elasticsearch errors Title: Cannot retrieve search results Description: A description is not needed as the title gives the reason Http errors Title: Cannot retrieve your data Description: Check your network and proxy configuration. If the problem persists, contact your network administrator. I'm assuming that the text in the blue box comes directly from ES or the HTTP response and can't be edited. Let me know otherwise. |
@elasticmachine merge upstream |
…into search/error-alignment-2
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.
Tested and LGTM, those error messages are a big improvement, and will help users (and also devs) to find the cause of the issue more quickly!
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, added a couple of very minor things below.
if (!isEsError(err)) return false; | ||
|
||
const rootCause = getRootCause(err as EsError); | ||
const rootCause = getRootCause(err as IEsError); |
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.
Is the cast here necessary (since you've checked isEsError
above, which is implemented as a type check)?
export function getFailedShards(err: IEsError) { | ||
const failedShards = | ||
err.body?.attributes?.error?.failed_shards || | ||
err.body?.attributes?.error?.caused_by?.failed_shards; |
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.
Nit: Prefer ??
to ||
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
page load bundle size
History
To update your PR or re-run it, just comment with: |
* Improve the display of ES errors and Http errors * fixes * Improve text * fix ts * update limit Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # packages/kbn-optimizer/limits.yml
…arm-phase-to-formlib * 'master' of github.com:elastic/kibana: [Trigger Actions UI] Properly unmount app (elastic#81436) skip flaky suite (elastic#81576) skip flaky suite (elastic#78373) [Security Solution] Fix styling of EditDataProvider content (elastic#81456) [Search] Error Alignment 2 (elastic#80965) [APM] Unskip test (elastic#81574) [ML] Fix partition value selection on the Single Metric Viewer (elastic#81585) cleaning up expression service types (elastic#80643) Fix suggestions dropdown for query input (elastic#80990) [Usage collection] Make `schema` mandatory (elastic#79999) [ILM] Update show/hide data tier logic on cloud (elastic#81455) added brace import to advanced settings (elastic#81458) chore(NA): add spec-to-console and plugin-helpers as devOnly dependencies
Summary
Improve the display of ES errors and HTTP errors
Elasticsearch errors
This PR adds explicit handling for all internal
Elasticsearch
errors, including the one mentioned on this issue. The new error message exposes thereason
returned, rather than showing the same stack trace every time.HTTP errors
Network or response parsing errors result in a very non descriptive errors, making SDH resolution more difficult.
This PR adds a more descriptive error for cases where
core.http.fetch
fails for various reasons.Checklist
Delete any items that are not applicable to this PR.
For maintainers