mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-25 15:52:06 +01:00
Show all exceptions ErrorsWhileSendingOrReceivingException message
This commit is contained in:
parent
1dd68336eb
commit
a9b88d7517
1 changed files with 23 additions and 1 deletions
|
@ -299,10 +299,32 @@ public class XmppConnectionStressTest {
|
|||
|
||||
private ErrorsWhileSendingOrReceivingException(Map<XMPPConnection, Exception> sendExceptions,
|
||||
Map<XMPPConnection, Exception> receiveExceptions) {
|
||||
super("Exceptions while sending and/or receiving");
|
||||
super(createMessageFrom(sendExceptions, receiveExceptions));
|
||||
this.sendExceptions = sendExceptions;
|
||||
this.receiveExceptions = receiveExceptions;
|
||||
}
|
||||
|
||||
private static String createMessageFrom(Map<XMPPConnection, Exception> sendExceptions,
|
||||
Map<XMPPConnection, Exception> receiveExceptions) {
|
||||
StringBuilder sb = new StringBuilder(1024);
|
||||
sb.append("Exceptions while sending and/or receiving.");
|
||||
|
||||
if (!sendExceptions.isEmpty()) {
|
||||
sb.append(" Send exxceptions: ");
|
||||
for (Map.Entry<XMPPConnection, Exception> entry : sendExceptions.entrySet()) {
|
||||
sb.append(entry.getKey()).append(": ").append(entry.getValue()).append(';');
|
||||
}
|
||||
}
|
||||
|
||||
if (!receiveExceptions.isEmpty()) {
|
||||
sb.append(" Receive exceptions: ");
|
||||
for (Map.Entry<XMPPConnection, Exception> entry : receiveExceptions.entrySet()) {
|
||||
sb.append(entry.getKey()).append(": ").append(entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue