Skip to content

Commit cae6e91

Browse files
committed
fix exceptions
1 parent 3756dfb commit cae6e91

5 files changed

Lines changed: 12 additions & 5 deletions

File tree

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcRuntimeException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.cloud.bigquery.exception;
1818

19-
2019
public class BigQueryJdbcRuntimeException extends RuntimeException {
2120

2221
/**

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ public class BigQueryJdbcSqlSyntaxErrorException extends SQLSyntaxErrorException
3333
public BigQueryJdbcSqlSyntaxErrorException(BigQueryException ex) {
3434
super(ex.getMessage(), "Incorrect SQL syntax.");
3535
}
36+
37+
public BigQueryJdbcSqlSyntaxErrorException(String message, BigQueryException ex) {
38+
super(message, ex);
39+
}
3640
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,9 @@ List<RoutineId> listMatchingProcedureIdsFromDatasets(
12511251

12521252
for (Dataset dataset : datasetsToScan) {
12531253
if (Thread.currentThread().isInterrupted()) {
1254-
InterruptedException ex = new InterruptedException("Interrupted while listing routines for catalog: " + catalogParam);
1254+
InterruptedException ex =
1255+
new InterruptedException(
1256+
"Interrupted while listing routines for catalog: " + catalogParam);
12551257
logger.severe(ex, ex.getMessage());
12561258
throw ex;
12571259
}
@@ -1283,7 +1285,8 @@ List<RoutineId> listMatchingProcedureIdsFromDatasets(
12831285
if (Thread.currentThread().isInterrupted()) {
12841286
listRoutineFutures.forEach(f -> f.cancel(true));
12851287
InterruptedException ex =
1286-
new InterruptedException("Interrupted while collecting routine lists for catalog: " + catalogParam);
1288+
new InterruptedException(
1289+
"Interrupted while collecting routine lists for catalog: " + catalogParam);
12871290
logger.severe(ex, ex.getMessage());
12881291
throw ex;
12891292
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
import javax.sql.PooledConnection;
2525

2626
public class PooledConnectionDataSource extends DataSource implements ConnectionPoolDataSource {
27-
private static final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(PooledConnectionDataSource.class.getName());
27+
private static final BigQueryJdbcCustomLogger LOG =
28+
new BigQueryJdbcCustomLogger(PooledConnectionDataSource.class.getName());
2829
private PooledConnectionListener connectionPoolManager = null;
2930
Connection bqConnection = null;
3031

java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void testInvalidTokenUriForAuthType0() {
111111
BigQueryJdbcOAuthUtility.getCredentials(oauthProperties, overrideProperties, false, null);
112112
Assertions.fail();
113113
} catch (BigQueryJdbcRuntimeException e) {
114-
assertThat(e.getMessage()).contains("java.net.URISyntaxException");
114+
assertThat(e.getMessage()).contains("Validation failure");
115115
}
116116
}
117117

0 commit comments

Comments
 (0)