aws / aws-secretsmanager-jdbc

The AWS Secrets Manager JDBC Library enables Java developers to easily connect to SQL databases using secrets stored in AWS Secrets Manager.
Apache License 2.0
161 stars 77 forks source link

Unwrap exceptions to check for error codes. #136

Closed danmancuso closed 1 year ago

danmancuso commented 2 years ago

Issue #, if available: https://github.com/aws/aws-secretsmanager-jdbc/issues/113 https://github.com/aws/aws-secretsmanager-jdbc/pull/18 https://github.com/aws/aws-secretsmanager-jdbc/pull/114

Description of changes: Combines the two pull requests and fixes the issue described in #113. Checks the thrown exception and all parent exceptions and returns true if a SQLException with a matching error code is found.

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

codecov-commenter commented 2 years ago

Codecov Report

Merging #136 (c50e2d6) into master (765270e) will decrease coverage by 0.07%. The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #136      +/-   ##
============================================
- Coverage     74.05%   73.97%   -0.08%     
- Complexity      116      117       +1     
============================================
  Files            10       11       +1     
  Lines           343      342       -1     
  Branches         42       42              
============================================
- Hits            254      253       -1     
  Misses           82       82              
  Partials          7        7              
Impacted Files Coverage Δ
...etsmanager/sql/AWSSecretsManagerMariaDBDriver.java 52.38% <100.00%> (-7.62%) :arrow_down:
...cretsmanager/sql/AWSSecretsManagerMySQLDriver.java 50.00% <100.00%> (-7.15%) :arrow_down:
...azonaws/secretsmanager/util/SQLExceptionUtils.java 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.