fix: should return null when getting blob fails (#4360)
This commit is contained in:
@@ -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