1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-10-31 22:15:59 +01:00

Add descriptive text to StanzaError.toString()

This commit is contained in:
Florian Schmaus 2019-03-08 13:50:54 +01:00
parent 5da6dea138
commit 7518bf9a25

View file

@ -198,6 +198,12 @@ public class StanzaError extends AbstractError implements ExtensionElement {
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder("XMPPError: "); StringBuilder sb = new StringBuilder("XMPPError: ");
sb.append(condition.toString()).append(" - ").append(type.toString()); sb.append(condition.toString()).append(" - ").append(type.toString());
String descriptiveText = getDescriptiveText();
if (descriptiveText != null) {
sb.append(" [").append(descriptiveText).append(']');
}
if (errorGenerator != null) { if (errorGenerator != null) {
sb.append(". Generated by ").append(errorGenerator); sb.append(". Generated by ").append(errorGenerator);
} }