fix: should return null when getting blob fails (#4360)

This commit is contained in:
X1a0t authored and GitHub committed 2023-09-14 16:55:57 +08:00
1 parent aa3b97b056
commit f79cd76cec
1 file changed
+7 -1
@@ -15,7 +15,13 @@ export const createCloudBlobStorage = (workspaceId: string): BlobStorage => {
return fetchWithTraceReport(
runtimeConfig.serverUrlPrefix +
`/api/workspaces/${workspaceId}/blobs/${key}`
).then(res => res.blob());
).then(res => {
if (!res.ok) {
// status not in the range 200-299
return null;
}
return res.blob();
});
},
set: async (key, value) => {
const {