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 } /**