(JabberDataBlock stanza)
| 197 | } |
| 198 | |
| 199 | public static XmppError findInStanza(JabberDataBlock stanza) { |
| 200 | XmppError err = decodeStanzaError(stanza.getChildBlock("error")); |
| 201 | // pytransports sends error description in body block |
| 202 | String body = stanza.getChildBlockText("body"); |
| 203 | if (body != null) err.text += "\n" + body; |
| 204 | return err; |
| 205 | } |
| 206 | |
| 207 | public static XmppError decodeStanzaError(JabberDataBlock error) { |
| 208 | if (!error.getTagName().equals("error")) throw new IllegalArgumentException(); |
no test coverage detected