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

@@ -55,6 +55,7 @@ const useStyles = makeStyles((theme) => ({
function mapStateToProps(state: AppState) {
return {
loading: state.tasks.activeTasks.loading,
error: state.tasks.activeTasks.error,
tasks: state.tasks.activeTasks.data,
batchActionPending: state.tasks.activeTasks.batchActionPending,
allActionPending: state.tasks.activeTasks.allActionPending,
@@ -133,6 +134,15 @@ function ActiveTasksTable(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">