From df945f5225c6f7962e2b56d8c899156df427920a Mon Sep 17 00:00:00 2001 From: Katherine Date: Thu, 23 Feb 2023 16:21:31 -0500 Subject: [PATCH] fix(smithy-client): optional param in error handling path (#4410) --- packages/smithy-client/src/default-error-handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/smithy-client/src/default-error-handler.ts b/packages/smithy-client/src/default-error-handler.ts index 944169e8f589..f76d5051a39c 100644 --- a/packages/smithy-client/src/default-error-handler.ts +++ b/packages/smithy-client/src/default-error-handler.ts @@ -12,7 +12,7 @@ export const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode const $metadata = deserializeMetadata(output); const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; const response = new exceptionCtor({ - name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknownError", + name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError", $fault: "client", $metadata, });