Skip to content

Missing properties in S3 thrown errors #7502

@Inqnuam

Description

@Inqnuam

Checkboxes for prior research

Describe the bug

Since v3.931.0 S3 Client's thrown errors not always include Code and some other properties

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/client-s3@3.931.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v22.21.1

Reproduction Steps

import { NoSuchUpload, S3 } from "@aws-sdk/client-s3";

const client = new S3();

try {
  await client.abortMultipartUpload({ Bucket: "my-bucket", Key: "my-key", UploadId: "this is a valid upload id" });
  await client.abortMultipartUpload({ Bucket: "my-bucket", Key: "my-key", UploadId: "invalid id" });
} catch (error: any) {
  // "Code" is undefined
  if (error.Code == "NoSuchUpload") {
    console.log(error.UploadId);
  }

  // well ...
  if (error instanceof NoSuchUpload) {
    // UploadId is undefined too!
    console.log(error.UploadId);
  }
}

Observed Behavior

error instance is missing important informations

Expected Behavior

For this example, error should include at least UploadId as before

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closed-for-stalenessp1This is a high priority issuepotential-regressionMarking this issue as a potential regression to be checked by team member

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions