unify the query error handling #1176
Labels
👤 closed for help 👥
Closed to external help, team only
📝 feature 🧠
New feature or request
🫣 331 🤫
Is only in scope within the current 331 branch
(Probably blocked by useQuery unification and the notification hook, maybe can work on it together)
Currently when an API request fails, we have a pretty inconsistent mix of
console.error
, throwing, and notifications.This needs to be unified. Ideally, we will show an antd notification for certain errors, and throw to error boundary on others.
The main errors and how I believe they should be handled are as follows:
Note that if any of the notification ones happen on a useQuery (when we are getting data), then its a bit unclear how it should be further handled with the absense of data. Discuss these cases with directors as they come up.
The notification should be consistent, and have info about what went wrong. You can investigate
throwOnError
in react query to filter out the non throws, then do some logic to handle when it doesnt throw. This can also be set globally in the App.tsx where the query client is created.The text was updated successfully, but these errors were encountered: