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

Passthrough source error as cause to AwsWrapperError constructor #375

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

adrianfalleiro
Copy link
Contributor

Summary

Passes through the source error from the pg/mysql driver to the AwsWrapperError constructor.

Description

I am currently using the mysql2 library and looking to integrate this wrapper with my project. The exceptions thrown by mysql2 include extra details that are useful for handling the error (code, errno, sqlState, sqlMessage and sql).

When this library throws an error, these details are lost because the error is wrapped in an AwsWrapperError and only the message is preserved. I noticed that this class accepts an optional cause in the constructor...but it's not being passed in ClientUtils.queryWithTimeout(). This PR fixes that.

Didn't add a test as I was unsure where it would belong. Happy to add one.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@adrianfalleiro
Copy link
Contributor Author

@karenc-bq @crystall-bitquill @sergiyvamz Tagging y'all because you reviewed and merged my previous PR. Thanks for looking at my PR.

Copy link
Contributor

@sophia-bq sophia-bq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adrianfalleiro,

Thank you for reaching out and raising this. Looks like a good change to me.

@sophia-bq
Copy link
Contributor

Hi @adrianfalleiro,

Thank you once again for your PR. I'd be happy to merge this change in for you, the branch just needs to be up to date with main. Would you like to update the branch or shall I?

@adrianfalleiro adrianfalleiro requested a review from a team as a code owner January 27, 2025 21:05
@adrianfalleiro
Copy link
Contributor Author

@sophia-bq thanks! Just updated it

@sophia-bq sophia-bq merged commit 132fd5d into aws:main Jan 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants