2
0
mirror of https://github.com/hibiken/asynqmon.git synced 2025-10-26 16:26:12 +08:00

Improve network error handling

This commit is contained in:
Ken Hibino
2021-01-26 21:25:42 -08:00
parent 1bee405599
commit a6498ca729
13 changed files with 288 additions and 104 deletions

View File

@@ -61,6 +61,7 @@ const useStyles = makeStyles((theme) => ({
function mapStateToProps(state: AppState) {
return {
loading: state.tasks.scheduledTasks.loading,
error: state.tasks.scheduledTasks.error,
tasks: state.tasks.scheduledTasks.data,
batchActionPending: state.tasks.scheduledTasks.batchActionPending,
allActionPending: state.tasks.scheduledTasks.allActionPending,
@@ -158,6 +159,14 @@ function ScheduledTasksTable(props: Props & ReduxProps) {
usePolling(fetchData, pollInterval);
if (props.error.length > 0) {
return (
<Alert severity="error">
<AlertTitle>Error</AlertTitle>
{props.error}
</Alert>
);
}
if (props.tasks.length === 0) {
return (
<Alert severity="info">