kibana
kibana copied to clipboard
[Metrics UI] Show toast errors when requests fail
Extending https://github.com/elastic/kibana/pull/96871, move the toast from useHttpRequest to useTrackedPromise so it shows up whenever a request fails. We should retain the option to pass in a type of toast (eg. warning instead of danger) that useHttpRequest has. Should probably pass in a string like warning | danger so we don't import everywhere.
There will be the error toast anytime a promise is rejected:
Currently there is no notification that something went wrong in some requests:

Be sure to test and create issues to fix requests that are not handling rejections properly or there are errors being surfaced with the toast we are not aware of. Sometimes we may not want a toast to show up, so consider adding a flag for that if it can't be handled better.
Improving the error handling of the requests is probably out of the scope of this issue and could be done in follow up PRs
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
We're not prioritizing this at this time.