fix: should return null when getting blob fails (#4360)
This commit is contained in:
1 parent
aa3b97b056
commit
f79cd76cec
1 file changed
+7
-1
@@ -15,7 +15,13 @@ export const createCloudBlobStorage = (workspaceId: string): BlobStorage => {
|
|||||||
return fetchWithTraceReport(
|
return fetchWithTraceReport(
|
||||||
runtimeConfig.serverUrlPrefix +
|
runtimeConfig.serverUrlPrefix +
|
||||||
`/api/workspaces/${workspaceId}/blobs/${key}`
|
`/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) => {
|
set: async (key, value) => {
|
||||||
const {
|
const {
|
||||||
|
|||||||
Reference in new issue
Block a user