Skip to content

Commit b644ae5

Browse files
committed
feat(smithy-client): add ExceptionOptionType type
1 parent 2613f66 commit b644ae5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/smithy-client/src/exceptions.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
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+
*/
8+
export type ExceptionOptionType<ExceptionType extends Error, BaseExceptionType extends Error> = Omit<
9+
ExceptionType,
10+
Exclude<keyof BaseExceptionType, "$metadata">
11+
>;
12+
313
export interface ServiceExceptionOptions extends SmithyException, MetadataBearer {
414
message?: string;
515
}

0 commit comments

Comments
 (0)