Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(server): handle s3 notfound error (#11386)

darkskygitadd4a5859de3
diff --git a/packages/backend/server/src/base/storage/providers/s3.ts b/packages/backend/server/src/base/storage/providers/s3.ts
index b0576ec93f..b918fed8d6 100644
--- a/packages/backend/server/src/base/storage/providers/s3.ts
+++ b/packages/backend/server/src/base/storage/providers/s3.ts
@@ -7,6 +7,7 @@ import {
HeadObjectCommand,
ListObjectsV2Command,
NoSuchKey,
+ NotFound,
PutObjectCommand,
S3Client,
S3ClientConfig,
@@ -98,7 +99,7 @@ export class S3StorageProvider implements StorageProvider {
};
} catch (e) {
// 404
- if (e instanceof NoSuchKey) {
+ if (e instanceof NoSuchKey || e instanceof NotFound) {
this.logger.verbose(`Object \`${key}\` not found`);
return undefined;
}