From 030da71b0fe66df4333a0d42771b4414a18ea9f8 Mon Sep 17 00:00:00 2001 From: AllanZhengYP Date: Mon, 14 Feb 2022 11:50:26 -0800 Subject: [PATCH] feat(smithy-client): add ExceptionOptionType type (#3314) --- packages/smithy-client/src/exceptions.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/smithy-client/src/exceptions.ts b/packages/smithy-client/src/exceptions.ts index 85b420cfef28..72cb433145d2 100644 --- a/packages/smithy-client/src/exceptions.ts +++ b/packages/smithy-client/src/exceptions.ts @@ -1,5 +1,16 @@ import { HttpResponse, MetadataBearer, ResponseMetadata, RetryableTrait, SmithyException } from "@aws-sdk/types"; +/** + * The type of the exception class constructor parameter. The returned type contains the properties + * in the `ExceptionType` but not in the `BaseExceptionType`. If the `BaseExceptionType` contains + * `$metadata` property, it's also included in the returned type. + * @internal + */ +export type ExceptionOptionType = Omit< + ExceptionType, + Exclude +>; + export interface ServiceExceptionOptions extends SmithyException, MetadataBearer { message?: string; }