From 8e93bd51dab2891377c964675cc76e71f4b2eb82 Mon Sep 17 00:00:00 2001 From: tecc Date: Sat, 17 Sep 2022 18:29:44 +0200 Subject: [PATCH] change: Check for `err.name === "NoSuchKey"` in S3 store NoSuchKey: I've observed errors to have the type property named `name` instead of `code` or `message`. See #144. --- libs/server/store/providers/s3.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/server/store/providers/s3.ts b/libs/server/store/providers/s3.ts index 7dac3b1..978ae2f 100644 --- a/libs/server/store/providers/s3.ts +++ b/libs/server/store/providers/s3.ts @@ -15,7 +15,7 @@ import { isEmpty, toNumber } from 'lodash'; import { Client as MinioClient } from 'minio'; function isNoSuchKey(err: any) { - return err.code === 'NoSuchKey' || err.message === 'NoSuchKey'; + return err.code === 'NoSuchKey' || err.message === 'NoSuchKey' || err.name === "NoSuchKey"; } /**