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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

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