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.
📝 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