Skip to content

Commit 1e8bb82

Browse files
author
Alexandru Scvortov
committed
more specific check for exceptions
Also, throw the exception we say we're throwing.
1 parent 11cf3e2 commit 1e8bb82

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/com/rabbitmq/client/impl/ChannelN.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public boolean waitForConfirms()
193193
synchronized (unconfirmedSet) {
194194
while (true) {
195195
if (getCloseReason() != null) {
196-
throw Utility.fixStackTrace(getCloseReason());
196+
throw new IOException(Utility.fixStackTrace(getCloseReason()));
197197
}
198198
if (unconfirmedSet.isEmpty()) {
199199
boolean noNacksReceived = !nacksReceived;
@@ -212,7 +212,7 @@ public void waitForConfirmsOrDie()
212212
if (!waitForConfirms()) {
213213
close(AMQP.REPLY_SUCCESS, "OK", true,
214214
new RuntimeException("received nack"), false);
215-
throw Utility.fixStackTrace(getCloseReason());
215+
throw new IOException(Utility.fixStackTrace(getCloseReason()));
216216
}
217217
}
218218

test/src/com/rabbitmq/client/test/functional/Confirm.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,10 @@ public void testWaitForConfirmsException()
261261
try {
262262
channel.waitForConfirmsOrDie();
263263
fail("waitAcks worked on a closed channel");
264-
} catch (Exception e) {
264+
} catch (IOException e) {
265265
//whoosh; everything ok
266+
} catch (InterruptedException e) {
267+
// whoosh; we should probably re-run, though
266268
}
267269
}
268270

0 commit comments

Comments
 (0)