Skip to content

Commit

Permalink
fix: Extract the rpc exception from IllegalStateExceptins in publish/…
Browse files Browse the repository at this point in the history
…subscribe (#430)
  • Loading branch information
palmere-google committed Dec 16, 2020
1 parent 02aea67 commit ff05b1a
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -67,7 +67,6 @@

/* Integration tests for VPC-SC */
public class ITVPCNegativeTest {

private static final boolean IS_VPCSC_TEST =
System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC") != null
&& System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC").equalsIgnoreCase("true");
Expand Down Expand Up @@ -330,7 +329,7 @@ public void deniedPublish() {
} catch (TimeoutException t) {
fail("Expected PERMISSION_DENIED CheckedApiException but got: " + t.toString());
} catch (IllegalStateException e) {
checkExceptionForVPCError(toCanonical(e));
checkExceptionForVPCError(toCanonical(e.getCause()));
}
}

Expand Down Expand Up @@ -367,7 +366,7 @@ public void deniedSubscriber() {
} catch (TimeoutException t) {
fail("Expected PERMISSION_DENIED CheckedApiException but got: " + t.toString());
} catch (IllegalStateException e) {
checkExceptionForVPCError(toCanonical(e));
checkExceptionForVPCError(toCanonical(e.getCause()));
}
}
}

0 comments on commit ff05b1a

Please sign in to comment.