Skip to content

Commit 030da71

Browse files
authored
feat(smithy-client): add ExceptionOptionType type (#3314)
1 parent e0697ed commit 030da71

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: packages/smithy-client/src/exceptions.ts

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
import { HttpResponse, MetadataBearer, ResponseMetadata, RetryableTrait, SmithyException } from "@aws-sdk/types";
22

3+
/**
4+
* The type of the exception class constructor parameter. The returned type contains the properties
5+
* in the `ExceptionType` but not in the `BaseExceptionType`. If the `BaseExceptionType` contains
6+
* `$metadata` property, it's also included in the returned type.
7+
* @internal
8+
*/
9+
export type ExceptionOptionType<ExceptionType extends Error, BaseExceptionType extends Error> = Omit<
10+
ExceptionType,
11+
Exclude<keyof BaseExceptionType, "$metadata">
12+
>;
13+
314
export interface ServiceExceptionOptions extends SmithyException, MetadataBearer {
415
message?: string;
516
}

0 commit comments

Comments
 (0)