1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-25 20:18:00 +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() {
StringBuilder sb = new StringBuilder("XMPPError: ");
sb.append(condition.toString()).append(" - ").append(type.toString());
String descriptiveText = getDescriptiveText();
if (descriptiveText != null) {
sb.append(" [").append(descriptiveText).append(']');
}
if (errorGenerator != null) {
sb.append(". Generated by ").append(errorGenerator);
}