Skip to content

Commit 4b5b0b5

Browse files
committed
fixed exception I was catching
1 parent fff1555 commit 4b5b0b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

auth/src/test/java/com/google/cloud/auth/samples/AuthExampleIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.google.api.apikeys.v2.Key;
2323
import com.google.cloud.ServiceOptions;
24+
import io.grpc.StatusRuntimeException;
2425
import java.io.ByteArrayOutputStream;
2526
import java.io.IOException;
2627
import java.io.PrintStream;
@@ -90,7 +91,7 @@ static String authenticateUsingApiKeyWithRetry(String apiKey) throws IOException
9091
for (int i = 0; i < retries; i++) {
9192
try {
9293
return ApiKeyAuthExample.authenticateUsingApiKey(apiKey);
93-
} catch (IOException e) {
94+
} catch (StatusRuntimeException e) {
9495
if (e.getMessage().contains("API key expired")) {
9596
System.out.println("API key not yet active, retrying...");
9697
try {

0 commit comments

Comments
 (0)