Type Alias AWSError

AWSError: {
    $fault: "client" | "server";
    $metadata: {
        attempts?: number;
        cfId?: string;
        extendedRequestId?: string;
        httpStatusCode?: number;
        requestId?: string;
        totalRetryDelay?: number;
    };
    message: string;
    name: string;
    $response?: {
        headers: Record<string, string>;
        body?: any;
        statusCode?: number;
    };
    $retryable?: { throttling?: boolean };
    $service?: string;
    stack?: string;
}

The error object that is emitted with error events from AWS.

Type declaration

  • Readonly$fault: "client" | "server"

    Whether the client or server are at fault.

  • Readonly$metadata: {
        attempts?: number;
        cfId?: string;
        extendedRequestId?: string;
        httpStatusCode?: number;
        requestId?: string;
        totalRetryDelay?: number;
    }
    • Optional Readonlyattempts?: number

      The number of times this operation was attempted.

    • Optional ReadonlycfId?: string

      A tertiary identifier for the last request sent. Used for debugging.

    • Optional ReadonlyextendedRequestId?: string

      A secondary identifier for the last request sent. Used for debugging.

    • Optional ReadonlyhttpStatusCode?: number

      The status code of the last HTTP response received for this operation.

    • Optional ReadonlyrequestId?: string

      A unique identifier for the last request sent for this operation. Often requested by AWS service teams to aid in debugging.

    • Optional ReadonlytotalRetryDelay?: number

      The total amount of time (in milliseconds) that was spent waiting between retry attempts.

  • message: string

    Human-readable error response message

  • Readonlyname: string

    Name, eg. ConditionalCheckFailedException

  • Optional Readonly$response?: { headers: Record<string, string>; body?: any; statusCode?: number }

    Represents an HTTP message as received in reply to a request

    • headers: Record<string, string>

      The headers of the HTTP message.

    • Optionalbody?: any

      The body of the HTTP message. Can be: ArrayBuffer | ArrayBufferView | string | Uint8Array | Readable | ReadableStream

    • OptionalstatusCode?: number

      The status code of the HTTP response.

  • Optional Readonly$retryable?: { throttling?: boolean }

    Indicates that an error MAY be retried by the client.

    • Optional Readonlythrottling?: boolean

      Indicates that the error is a retryable throttling error.

  • Optional Readonly$service?: string

    The service that encountered the exception.

  • Optionalstack?: string

    Non-standard stacktrace