From 938010fc2479c567d208707c6757a006089b7421 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Thu, 3 Apr 2025 11:14:11 +0000 Subject: [PATCH] xml-parser.parseResponseError(): return parsed error instead of throwing Closes #1400 --- src/internal/xml-parser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/xml-parser.ts b/src/internal/xml-parser.ts index fa06933c..4cef51de 100644 --- a/src/internal/xml-parser.ts +++ b/src/internal/xml-parser.ts @@ -103,7 +103,7 @@ export async function parseResponseError(response: http.IncomingMessage): Promis const xmlString = await readAsString(response) if (xmlString) { - throw parseError(xmlString, headerInfo) + return parseError(xmlString, headerInfo) } // Message should be instantiated for each S3Errors. @@ -115,7 +115,7 @@ export async function parseResponseError(response: http.IncomingMessage): Promis e[key] = value }) - throw e + return e } /**