log policy violation stream error message to logcat

This commit is contained in:
Daniel Gultsch 2018-12-18 11:02:25 +01:00
parent 5c920a9362
commit 9659f46136
1 changed files with 5 additions and 1 deletions

View File

@ -1311,7 +1311,11 @@ public class XmppConnection implements Runnable {
throw new IOException(); throw new IOException();
} else if (streamError.hasChild("host-unknown")) { } else if (streamError.hasChild("host-unknown")) {
throw new StateChangingException(Account.State.HOST_UNKNOWN); throw new StateChangingException(Account.State.HOST_UNKNOWN);
} else if (streamError.hasChild("policy-violation")) { } else if (streamError.hasChild("policy-violation")) { ;
final String text = streamError.findChildContent("text");
if (text != null) {
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": policy violation. "+text);
}
throw new StateChangingException(Account.State.POLICY_VIOLATION); throw new StateChangingException(Account.State.POLICY_VIOLATION);
} else { } else {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": stream error " + streamError.toString()); Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": stream error " + streamError.toString());