From 732cfa8791bae680650fa47091f1d93682a6ad64 Mon Sep 17 00:00:00 2001 From: williamlardier Date: Tue, 26 Nov 2024 11:58:28 +0100 Subject: [PATCH] Ensure no behavior change with non arsenal errors processing Issue: ARSN-441 --- lib/s3routes/routes/routeDELETE.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/s3routes/routes/routeDELETE.ts b/lib/s3routes/routes/routeDELETE.ts index 235cac33d..484799c10 100644 --- a/lib/s3routes/routes/routeDELETE.ts +++ b/lib/s3routes/routes/routeDELETE.ts @@ -58,7 +58,10 @@ export default function routeDELETE( * the object, the errors NoSuchKey and NoSuchVersion should not * be sent back as a response. */ - if (err instanceof ArsenalError && !err.is?.NoSuchKey && !err.is?.NoSuchVersion) { + if (err && ( + !(err instanceof ArsenalError) || + (!err.is.NoSuchKey && err.is.NoSuchVersion) + )) { return routesUtils.responseNoBody(err, corsHeaders, response, undefined, log); }