Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instaceof with Exceptions is broken. #6771

Closed
4 tasks done
sobolk opened this issue Jan 2, 2025 · 1 comment
Closed
4 tasks done

instaceof with Exceptions is broken. #6771

sobolk opened this issue Jan 2, 2025 · 1 comment
Labels
bug This issue is a bug. p1 This is a high priority issue pending-release This issue will be fixed by an approved PR that hasn't been released yet. potential-regression Marking this issue as a potential regression to be checked by team member

Comments

@sobolk
Copy link

sobolk commented Jan 2, 2025

Checkboxes for prior research

Describe the bug

We (AWS Amplify) got broken by smithy-lang/smithy-typescript#1484 .

This was dectected by our canary workflow here
https://github.com/aws-amplify/amplify-backend/actions/runs/12586737788/job/35081205621 .

Minimal repro:

import { NoSuchKey, S3, S3ServiceException } from '@aws-sdk/client-s3';

const dummyS3ServiceException = new S3ServiceException({
    name: 'TEST_ERROR',
    message: 'TEST_MESSAGE',
    $fault: 'server',
    $metadata: {},
});

console.log(dummyS3ServiceException instanceof NoSuchKey)

Prints

bcd0740fa72c:testapp073 sobkamil$ node index.js
true

The dummy S3ServiceException is not NoSuchKey error !!!

Regression Issue

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

SDK version number

"@aws-sdk/client-s3": "^3.721.0"

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.18.1

Reproduction Steps

Minimal repro:

import { NoSuchKey, S3, S3ServiceException } from '@aws-sdk/client-s3';

const dummyS3ServiceException = new S3ServiceException({
    name: 'TEST_ERROR',
    message: 'TEST_MESSAGE',
    $fault: 'server',
    $metadata: {},
});

console.log(dummyS3ServiceException instanceof NoSuchKey)

Prints

bcd0740fa72c:testapp073 sobkamil$ node index.js
true

Observed Behavior

Exceptions are misscategorized with instaceof operator

Expected Behavior

console.log(dummyS3ServiceException instanceof NoSuchKey) returns false

Possible Solution

Revert smithy-lang/smithy-typescript#1484

Additional Information/Context

No response

@sobolk sobolk added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 2, 2025
@github-actions github-actions bot added the potential-regression Marking this issue as a potential regression to be checked by team member label Jan 2, 2025
@sobolk sobolk changed the title instace of with Exceptions is broken. instaceof with Exceptions is broken. Jan 2, 2025
@aBurmeseDev aBurmeseDev added pending-release This issue will be fixed by an approved PR that hasn't been released yet. p1 This is a high priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 2, 2025
@aBurmeseDev
Copy link
Member

Hi @sobolk - it appears PR was merged and issue was resolved internally. Thanks again for reporting this. Closing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p1 This is a high priority issue pending-release This issue will be fixed by an approved PR that hasn't been released yet. potential-regression Marking this issue as a potential regression to be checked by team member
Projects
None yet
Development

No branches or pull requests

2 participants