Skip to content

Commit 12e3e7b

Browse files
authored
fix: include value of INSTANCE_CONNECTION_NAME when invalid (#752)
1 parent d316db1 commit 12e3e7b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/src/main/java/com/google/cloud/sql/core/CloudSqlInstance.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,14 @@ class CloudSqlInstance {
133133
ListeningScheduledExecutorService executor,
134134
ListenableFuture<KeyPair> keyPair) {
135135

136-
this.connectionName = connectionName;
137136
Matcher matcher = CONNECTION_NAME.matcher(connectionName);
138137
checkArgument(
139138
matcher.matches(),
140-
"[%s] Cloud SQL connection name is invalid, expected string in the form of"
141-
+ " \"<PROJECT_ID>:<REGION_ID>:<INSTANCE_ID>\".");
139+
String.format(
140+
"[%s] Cloud SQL connection name is invalid, expected string in the form of"
141+
+ " \"<PROJECT_ID>:<REGION_ID>:<INSTANCE_ID>\".",
142+
connectionName));
143+
this.connectionName = connectionName;
142144
this.projectId = matcher.group(1);
143145
this.regionId = matcher.group(3);
144146
this.instanceId = matcher.group(4);

0 commit comments

Comments
 (0)