Skip to content

Commit 3b64218

Browse files
authored
Do not throw an error when a model fetch returns a 404 (#1378)
1 parent ff55958 commit 3b64218

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/shell/store/models.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,21 @@ export function fetchModel(modelZUID) {
9999
type: "FETCH_MODEL_SUCCESS",
100100
payload: res.data,
101101
});
102+
} else if (res.status === 404) {
103+
/*
104+
Do nothing; this most likely means the model existed at one point
105+
and was deleted. This action may be improved in the future if
106+
the ability to fetch deleted items is added to the api
107+
*/
102108
} else {
103109
dispatch(
104110
notify({
105111
kind: "warn",
106112
message: `Failed to fetch models`,
107113
})
108114
);
109-
if (res.error || res.status === 404) {
110-
throw new Error(res.error);
115+
if (res.error || res.message) {
116+
throw new Error(res.error || res.message);
111117
}
112118
}
113119
},

0 commit comments

Comments
 (0)