diff --git a/amazon-kinesis-client/src/test/java/software/amazon/kinesis/utils/StreamExistenceManager.java b/amazon-kinesis-client/src/test/java/software/amazon/kinesis/utils/StreamExistenceManager.java index 0181a222..ee0450a0 100644 --- a/amazon-kinesis-client/src/test/java/software/amazon/kinesis/utils/StreamExistenceManager.java +++ b/amazon-kinesis-client/src/test/java/software/amazon/kinesis/utils/StreamExistenceManager.java @@ -43,10 +43,12 @@ public class StreamExistenceManager { throw new RuntimeException("Stream is not active, instead in status: " + response.streamDescriptionSummary().streamStatus()); } return true; - } catch (ResourceNotFoundException e) { - return false; } catch (ExecutionException e) { - throw new RuntimeException(e); + if (e.getCause() instanceof ResourceNotFoundException) { + return false; + } else { + throw new RuntimeException(e); + } } catch (Exception e) { throw new RuntimeException(e); }