elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.79k stars 8.19k forks source link

React Query API error handling #157506

Open CoenWarmer opened 1 year ago

CoenWarmer commented 1 year ago

📝 Summary

React Query expects errors from an http fetching library to be in a certain form. Kibana's http is not a returning its error in the form that React Query likes, leading it to be difficult to show API error reason messages returned from the API inside Toasts.

An example of how it was implemented now is:

This utility can be improved, and should be implemented in all React Query hooks in the Observability app to have a uniform experience.

_Originally posted by @kdelemme in https://github.com/elastic/kibana/pull/157488#discussion_r1192419644_

✅ Acceptance criteria

elasticmachine commented 1 year ago

Pinging @elastic/actionable-observability (Team: Actionable Observability)