Skip to content

Commit

Permalink
Handle all failed network request errors (#3214)
Browse files Browse the repository at this point in the history
Add handling for all failed network requests to clean up the sentry log
Fixes #3204
  • Loading branch information
finnar-bin authored Feb 13, 2025
1 parent 78cf4c8 commit 0013f03
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/shell/store/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ export function searchItems(
}
return res;
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to search item: ${err?.message || err || ""}`,
})
);
},
});
};
}
Expand Down Expand Up @@ -915,6 +923,16 @@ export function fetchItemPublishing(modelZUID, itemZUID) {
);
}
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to fetch item publishing: ${
err?.message || err || ""
}`,
})
);
},
});
};
}
Expand All @@ -941,6 +959,16 @@ export function fetchItemPublishings() {
);
}
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to fetch item publishings: ${
err?.message || err || ""
}`,
})
);
},
});
};
}
Expand Down
8 changes: 8 additions & 0 deletions src/shell/store/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ export function fetchField(modelZUID, fieldZUID) {
},
});
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to fetch field: ${err?.message || err || ""}`,
})
);
},
});
};
}
Expand Down
8 changes: 8 additions & 0 deletions src/shell/store/headTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ export const fetchHeadTags = () => {
}
}
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to fetch head tags: ${err?.message || err || ""}`,
})
);
},
});
};
};
Expand Down
34 changes: 34 additions & 0 deletions src/shell/store/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,14 @@ function fetchGroups(binZUID) {
throw res;
}
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to fetch groups: ${err?.message || err || ""}`,
})
);
},
});
};
}
Expand Down Expand Up @@ -521,6 +529,14 @@ export function fetchBinFiles(binZUID) {
throw res;
}
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to fetch bin files: ${err?.message || err || ""}`,
})
);
},
});
};
}
Expand All @@ -543,6 +559,16 @@ export function fetchGroupFiles(groupZUID) {
throw res;
}
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to fetch group files: ${
err?.message || err || ""
}`,
})
);
},
});
};
}
Expand Down Expand Up @@ -769,6 +795,14 @@ export function searchFiles(term) {
throw res;
}
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to search for file: ${err?.message || err || ""}`,
})
);
},
});
};
}
8 changes: 8 additions & 0 deletions src/shell/store/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ export function fetchModel(modelZUID) {
}
}
},
error: (err) => {
dispatch(
notify({
kind: "warn",
message: `Failed to fetch model: ${err?.message || err || ""}`,
})
);
},
});
};
}
Expand Down

0 comments on commit 0013f03

Please sign in to comment.