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 Readonly attempts?: number

      The number of times this operation was attempted.

    • Optional Readonly cfId?: string

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

    • Optional Readonly extendedRequestId?: string

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

    • Optional Readonly httpStatusCode?: number

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

    • Optional Readonly requestId?: string

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

    • Optional Readonly totalRetryDelay?: number

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

  • message: string

    Human-readable error response message

  • Readonly name: 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.

    • Optional body?: any

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

    • Optional statusCode?: number

      The status code of the HTTP response.

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

    Indicates that an error MAY be retried by the client.

    • Optional Readonly throttling?: boolean

      Indicates that the error is a retryable throttling error.

  • Optional Readonly $service?: string

    The service that encountered the exception.

  • Optional stack?: string

    Non-standard stacktrace