UNPKG

1.35 kBTypeScriptView Raw
1import { HttpResponse, MetadataBearer, ResponseMetadata, RetryableTrait, SmithyException } from "@aws-sdk/types";
2/**
3 * The type of the exception class constructor parameter. The returned type contains the properties
4 * in the `ExceptionType` but not in the `BaseExceptionType`. If the `BaseExceptionType` contains
5 * `$metadata` property, it's also included in the returned type.
6 * @internal
7 */
8export declare type ExceptionOptionType<ExceptionType extends Error, BaseExceptionType extends Error> = Omit<ExceptionType, Exclude<keyof BaseExceptionType, "$metadata">>;
9export interface ServiceExceptionOptions extends SmithyException, MetadataBearer {
10 message?: string;
11}
12/**
13 * Base exception class for the exceptions from the server-side.
14 */
15export declare class ServiceException extends Error implements SmithyException, MetadataBearer {
16 readonly $fault: "client" | "server";
17 $response?: HttpResponse;
18 $retryable?: RetryableTrait;
19 $metadata: ResponseMetadata;
20 constructor(options: ServiceExceptionOptions);
21}
22/**
23 * This method inject unmodeled member to a deserialized SDK exception,
24 * and load the error message from different possible keys('message',
25 * 'Message').
26 *
27 * @internal
28 */
29export declare const decorateServiceException: <E extends ServiceException>(exception: E, additions?: Record<string, any>) => E;