Skip to content

Commit

Permalink
fix(smithy-client): optional param in error handling path (#4410)
Browse files Browse the repository at this point in the history
  • Loading branch information
krosenk729 authored Feb 23, 2023
1 parent 6862051 commit df945f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/smithy-client/src/default-error-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down

0 comments on commit df945f5

Please sign in to comment.