mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-25 21:42:07 +01:00
Add more information to NotConnectedException
This commit is contained in:
parent
a854e04d28
commit
a85ba5311e
2 changed files with 12 additions and 2 deletions
|
@ -166,6 +166,11 @@ public class SmackException extends Exception {
|
||||||
public NotConnectedException() {
|
public NotConnectedException() {
|
||||||
super("Client is not, or no longer, connected");
|
super("Client is not, or no longer, connected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NotConnectedException(XMPPConnection connection, String details) {
|
||||||
|
super("The connection " + connection.toString() + " is no longer connected. "
|
||||||
|
+ details);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class IllegalStateChangeException extends SmackException {
|
public static class IllegalStateChangeException extends SmackException {
|
||||||
|
|
|
@ -1210,9 +1210,14 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void throwNotConnectedExceptionIfDoneAndResumptionNotPossible() throws NotConnectedException {
|
protected void throwNotConnectedExceptionIfDoneAndResumptionNotPossible() throws NotConnectedException {
|
||||||
if (done() && !isSmResumptionPossible()) {
|
final boolean done = done();
|
||||||
|
if (done) {
|
||||||
|
final boolean smResumptionPossbile = isSmResumptionPossible();
|
||||||
// Don't throw a NotConnectedException is there is an resumable stream available
|
// Don't throw a NotConnectedException is there is an resumable stream available
|
||||||
throw new NotConnectedException();
|
if (!smResumptionPossbile) {
|
||||||
|
throw new NotConnectedException(XMPPTCPConnection.this, "done=" + done
|
||||||
|
+ " smResumptionPossible=" + smResumptionPossbile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue