-
Notifications
You must be signed in to change notification settings - Fork 8
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
Added error handling to schedule tab #1014
base: 1.x
Are you sure you want to change the base?
Conversation
if (isLoading || data === undefined) { | ||
return <Content loading /> | ||
} | ||
|
||
if (isError) { | ||
trackError(new ApiError(error)) | ||
return <div>Error</div> | ||
} | ||
|
||
if (isLoading || data === undefined) { | ||
return <Content loading /> | ||
} | ||
|
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.
@markus-moser, as you see here, I moved the isError
condition above the isLoading
condition since rtk doesn't reset the isLoading
when an error is thrown.
This leads to the behavior that now "error" appears in the tab instead of an infinite loading spinner ... Should we define an "error view" similar to the empty content or loading view?
WDYT
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.
Yes I would go for an error view where we show the error message instead - maybe a simple (and then remove the default handling with the alert).
|
Changes in this pull request
Resolves #971
Additional info
This pull request includes changes to improve error handling in the
VersionIdCell
andScheduleTabContainer
components by adding error tracking and handling mechanisms. The most important changes include adding imports for the error handling utilities and modifying the components to track and handle errors appropriately.Error handling improvements:
assets/js/src/core/modules/element/dynamic-types/defintinitions/grid-cell/components/_schedule/version-id-cell/version-id-cell.tsx
: Added imports fortrackError
andApiError
, and modified theVersionIdCell
component to track errors using these utilities.assets/js/src/core/modules/element/editor/shared-tab-manager/tabs/schedule/schedule-container.tsx
: Added imports fortrackError
andApiError
, and modified theScheduleTabContainer
component to track errors using these utilities. [1] [2] [3]