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

DynamoDB SDK missing the ValidationException class #6696

Open
2 tasks
alfaproject opened this issue Nov 26, 2024 · 3 comments
Open
2 tasks

DynamoDB SDK missing the ValidationException class #6696

alfaproject opened this issue Nov 26, 2024 · 3 comments
Labels
feature-request New feature or enhancement. May require GitHub community feedback. p3 This is a minor priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@alfaproject
Copy link

Describe the feature

For some reason, DynamoDB SDK is missing the ValidationException class from the exported exception classes which goes against the philosophy of the new SDK

Use Case

Consistency with checking exception types:

if (error instanceof ConditionalCheckFailedException || error.name === 'ValidationException') {
}

Proposed Solution

Create the ValidationException class and export it

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

Latest

Environment details (OS name and version, etc.)

Linux

@alfaproject alfaproject added feature-request New feature or enhancement. May require GitHub community feedback. needs-triage This issue or PR still needs to be triaged. labels Nov 26, 2024
@alfaproject
Copy link
Author

This is a duplicate of #3618 and I'm not really sure why that was closed. This is still an issue and inconsistent...

@RanVaknin
Copy link
Contributor

RanVaknin commented Nov 26, 2024

Hi @alfaproject ,

I'm not really sure why that was closed.

It was closed because the original poster closed it.

For some reason, DynamoDB SDK is missing the ValidationException class from the exported exception classes which goes against the philosophy of the new SDK

The reason the DynamoDB SDK is missing the ValidationException class is because the SDK is code-generated from the API model definition of the Dynamodb service, which lacks this exception definition. You can see the generated dynamodb API docs do not have ValidationException listed under the list of common errors https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/CommonErrors.html

You can check the model file the SDK is generated from and see that the validation exception is indeed missing.

The SDK team cannot "Add" that missing exception class because it must be added by the dynamodb service team itself first. Instead, I have reached out to the DDB team internally (ticket ID #P173513119) and asked them to add the exception in question to their model file so the SDK can get generated with the exception in question. If you have access to AWS support, you can open your own support ticket and reference the ticket I have created for more visibility.

In the meantime, it's safe to use error.name === "ValidationException".

Thanks,
Ran~

@RanVaknin RanVaknin added service-api This issue is due to a problem in a service API, not the SDK implementation. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 26, 2024
@alfaproject
Copy link
Author

Thank you for looking into this and reaching out to DDB team.

Couple of questions tho, if those errors are common and shared with different (all?) services, shouldn't they be abstracted away from each individual service into some common package?

That linked page to the common errors has ValidationError as opposed to ValidationException. Not sure if it matters, but just wanted to point it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or enhancement. May require GitHub community feedback. p3 This is a minor priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants