use of org.jivesoftware.smack.XMPPException.StreamErrorException in project Smack by igniterealtime.
the class AbstractXMPPConnection method callConnectionClosedOnErrorListener.
protected void callConnectionClosedOnErrorListener(Exception e) {
boolean logWarning = true;
if (e instanceof StreamErrorException) {
StreamErrorException see = (StreamErrorException) e;
if (see.getStreamError().getCondition() == StreamError.Condition.not_authorized && wasAuthenticated) {
logWarning = false;
LOGGER.log(Level.FINE, "Connection closed with not-authorized stream error after it was already authenticated. The account was likely deleted/unregistered on the server");
}
}
if (logWarning) {
LOGGER.log(Level.WARNING, "Connection " + this + " closed with error", e);
}
for (ConnectionListener listener : connectionListeners) {
try {
listener.connectionClosedOnError(e);
} catch (Exception e2) {
// Catch and print any exception so we can recover
// from a faulty listener
LOGGER.log(Level.SEVERE, "Error in listener while closing connection", e2);
}
}
}
Aggregations