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

This commit is contained in:
X1a0t
2023-09-14 16:55:57 +08:00
committed by GitHub
parent aa3b97b056
commit f79cd76cec

View File

@@ -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 {