-
Notifications
You must be signed in to change notification settings - Fork 21
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
Initial error handling implementation #431
Conversation
Deploying opendataeditor with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @roll ! It reminds me a lot to go pattern:
result, err := doSomething()
if err != nil {
log.Fatal(err)
}
Note: Is is truly necessary to repeat all the Error.tsx
components?
@pdelboca
Yea, exactly. Still not sure if it's the best one as it's great without nesting but if you have nested actions (e.g. doSomethign -> loadFields -> client.load) you need to have signature on the actions as well. I'll investigate further
I think it will be eliminated in #430; it will have an error state only in one store so the error component will be global as well |
In this PR we start catching all the possible server errors and reflect them in the UI (exact UI can be updated later). Currently, error handling in actions is quite verbose but can be improved in #430 (using some kind of error boundaries in actions). Also, this iteration doesn't fully cover nested action errors (still can get into an inconsistent state), which also needs to be addressed in #430.
Other follow-up issues: