UNPKG

2.29 kBTypeScriptView Raw
1import { HttpResponse } from "./http";
2import { MetadataBearer } from "./response";
3/**
4 * @public
5 *
6 * A document type represents an untyped JSON-like value.
7 *
8 * Not all protocols support document types, and the serialization format of a
9 * document type is protocol specific. All JSON protocols SHOULD support
10 * document types and they SHOULD serialize document types inline as normal
11 * JSON values.
12 */
13export type DocumentType = null | boolean | number | string | DocumentType[] | {
14 [prop: string]: DocumentType;
15};
16/**
17 * @public
18 *
19 * A structure shape with the error trait.
20 * https://smithy.io/2.0/spec/behavior-traits.html#smithy-api-retryable-trait
21 */
22export interface RetryableTrait {
23 /**
24 * Indicates that the error is a retryable throttling error.
25 */
26 readonly throttling?: boolean;
27}
28/**
29 * @public
30 *
31 * Type that is implemented by all Smithy shapes marked with the
32 * error trait.
33 * @deprecated
34 */
35export interface SmithyException {
36 /**
37 * The shape ID name of the exception.
38 */
39 readonly name: string;
40 /**
41 * Whether the client or server are at fault.
42 */
43 readonly $fault: "client" | "server";
44 /**
45 * The service that encountered the exception.
46 */
47 readonly $service?: string;
48 /**
49 * Indicates that an error MAY be retried by the client.
50 */
51 readonly $retryable?: RetryableTrait;
52 /**
53 * Reference to low-level HTTP response object.
54 */
55 readonly $response?: HttpResponse;
56}
57/**
58 * @public
59 *
60 * @deprecated See {@link https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/}
61 *
62 * This type should not be used in your application.
63 * Users of the AWS SDK for JavaScript v3 service clients should prefer to
64 * use the specific Exception classes corresponding to each operation.
65 * These can be found as code in the deserializer for the operation's Command class,
66 * or as declarations in the service model file in codegen/sdk-codegen/aws-models.
67 *
68 * If no exceptions are enumerated by a particular Command operation,
69 * the base exception for the service should be used. Each client exports
70 * a base ServiceException prefixed with the service name.
71 */
72export type SdkError = Error & Partial<SmithyException> & Partial<MetadataBearer>;