condition = PacketError.Condition.fromXMPP(tag);
} catch (IllegalArgumentException e) {
condition = PacketError.Condition.undefined_condition;
LOG.warning("Did not understand error condition, defaulting to: " + condition.name());
}
PacketError result = new PacketError(condition);
if (error.hasErrorMessage()) {
// TODO(thorogood): Hide this behind a flag so we don't always broadcast error cases.
result.setText(error.getErrorMessage(), "en");
}
return result;
}