Skip to content
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

React Query API error handling #157506

Open
CoenWarmer opened this issue May 12, 2023 · 1 comment
Open

React Query API error handling #157506

CoenWarmer opened this issue May 12, 2023 · 1 comment
Labels
epic Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge"

Comments

@CoenWarmer
Copy link
Contributor

CoenWarmer commented May 12, 2023

📝 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 #157488 (comment)

✅ Acceptance criteria

@botelastic botelastic bot added the needs-team Issues missing a team label label May 12, 2023
@CoenWarmer CoenWarmer added Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" and removed needs-team Issues missing a team label labels May 12, 2023
@elasticmachine
Copy link
Contributor

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

@CoenWarmer CoenWarmer changed the title Should we be more defensive here and fallback to a generic message if the body.message does not exist? Improve React Query API error handling May 12, 2023
@emma-raffenne emma-raffenne added this to the 8.10 milestone Aug 7, 2023
@emma-raffenne emma-raffenne changed the title Improve React Query API error handling React Query API error handling Aug 17, 2023
@emma-raffenne emma-raffenne removed this from the 8.10 milestone Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge"
Projects
None yet
Development

No branches or pull requests

3 participants