Conversation

olavloite

Improve error messages when something is wrong in the connection string.

Fixes googleapis/java-spanner-jdbc#399

Improve error messages when something is wrong in the connection string.

Fixes #java-spanner-jdbc/399
@olavloiteolavloite requested a review from a team as a code owner March 23, 2021 18:18
@google-clagoogle-cla bot added the cla: yesThis human has signed the Contributor License Agreement.label Mar 23, 2021
@product-auto-labelproduct-auto-label bot added the api: spannerIssues related to the googleapis/java-spanner API.label Mar 23, 2021
@olavloite

cc @jimmyruska

@codecov

Codecov Report

Merging #1011 (47c3b99) into master (9132c21) will decrease coverage by 0.08%.
The diff coverage is 71.79%.

❗ Current head 47c3b99 differs from pull request most recent head 3815456. Consider uploading reports for the commit 3815456 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1011      +/-   ##
============================================
- Coverage     85.14%   85.06%   -0.09%     
- Complexity     2622     2623       +1     
============================================
  Files           154      154              
  Lines         14329    14362      +33     
  Branches       1334     1340       +6     
============================================
+ Hits          12201    12217      +16     
- Misses         1565     1576      +11     
- Partials        563      569       +6     
Impacted FilesCoverage ΔComplexity Δ
...e/cloud/spanner/connection/CredentialsService.java83.33% <60.00%> (-6.67%)8.00 <0.00> (ø)
...le/cloud/spanner/connection/ConnectionOptions.java88.80% <73.52%> (-1.73%)94.00 <5.00> (+5.00)⬇️
.../google/cloud/spanner/AbstractLazyInitializer.java92.85% <0.00%> (-7.15%)4.00% <0.00%> (-1.00%)
...a/com/google/cloud/spanner/SpannerRetryHelper.java80.95% <0.00%> (-3.67%)3.00% <0.00%> (ø%)
...ud/spanner/SessionPoolAsyncTransactionManager.java85.71% <0.00%> (-1.51%)12.00% <0.00%> (-2.00%)
...m/google/cloud/spanner/connection/SpannerPool.java87.36% <0.00%> (-0.53%)33.00% <0.00%> (ø%)
...a/com/google/cloud/spanner/AsyncResultSetImpl.java91.89% <0.00%> (-0.39%)32.00% <0.00%> (ø%)
...ain/java/com/google/cloud/spanner/SessionPool.java88.93% <0.00%> (-0.20%)72.00% <0.00%> (ø%)
...a/com/google/cloud/spanner/SessionPoolOptions.java69.53% <0.00%> (ø)17.00% <0.00%> (-1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9132c21...3815456. Read the comment docs.

* Executes a quick check to see if this connection can actually connect to a local emulator host
* or other (mock) test server, if the options point to localhost instead of Cloud Spanner.
*/
private void checkLocalConnection() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we extract a class for this? I feel this class is very big already.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I've moved it to a separate class.

@olavloiteolavloite added the kokoro:force-runAdd this label to force Kokoro to re-run the tests.label Mar 26, 2021
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-runAdd this label to force Kokoro to re-run the tests.label Mar 26, 2021
@thiagotnunesthiagotnunes merged commit 7dacfdc into master Mar 28, 2021
@thiagotnunesthiagotnunes deleted the error-msg-connection branch March 28, 2021 23:41
rajatbhatta pushed a commit to rajatbhatta/java-spanner that referenced this pull request Nov 17, 2022
Sign up for free to join this conversation on . Already have an account? Sign in to comment
api: spannerIssues related to the googleapis/java-spanner API.cla: yesThis human has signed the Contributor License Agreement.
None yet

Successfully merging this pull request may close these issues.

Better error messages when things fail