From c9cf9d0246701da73c1c6e30df75446461127dd8 Mon Sep 17 00:00:00 2001 From: AllanZhengYP Date: Mon, 14 Feb 2022 20:26:04 +0000 Subject: [PATCH] fix(smithy-client): decorateServiceException not to overwrite modeled members --- packages/smithy-client/src/exceptions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/smithy-client/src/exceptions.ts b/packages/smithy-client/src/exceptions.ts index a3801f87da8c..76d35d8cc5b2 100644 --- a/packages/smithy-client/src/exceptions.ts +++ b/packages/smithy-client/src/exceptions.ts @@ -49,7 +49,7 @@ export const decorateServiceException = ( .filter(([, v]) => v !== undefined) .forEach(([k, v]) => { // @ts-ignore assign unmodeled keys - exception[k] = v; + exception[k] = exception[k] ?? v; }); // load error message from possible locations // @ts-expect-error message could exist in Message key.