Skip to content

Commit ff05b1a

Browse files
fix: Extract the rpc exception from IllegalStateExceptins in publish/subscribe (#430)
1 parent 02aea67 commit ff05b1a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

google-cloud-pubsublite/src/test/java/com/google/cloud/pubsublite/it/ITVPCNegativeTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767

6868
/* Integration tests for VPC-SC */
6969
public class ITVPCNegativeTest {
70-
7170
private static final boolean IS_VPCSC_TEST =
7271
System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC") != null
7372
&& System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC").equalsIgnoreCase("true");
@@ -330,7 +329,7 @@ public void deniedPublish() {
330329
} catch (TimeoutException t) {
331330
fail("Expected PERMISSION_DENIED CheckedApiException but got: " + t.toString());
332331
} catch (IllegalStateException e) {
333-
checkExceptionForVPCError(toCanonical(e));
332+
checkExceptionForVPCError(toCanonical(e.getCause()));
334333
}
335334
}
336335

@@ -367,7 +366,7 @@ public void deniedSubscriber() {
367366
} catch (TimeoutException t) {
368367
fail("Expected PERMISSION_DENIED CheckedApiException but got: " + t.toString());
369368
} catch (IllegalStateException e) {
370-
checkExceptionForVPCError(toCanonical(e));
369+
checkExceptionForVPCError(toCanonical(e.getCause()));
371370
}
372371
}
373372
}

0 commit comments

Comments
 (0)