public final XmlBlasterException getException() {
if (msgVec.isEmpty()) {
throw new IllegalArgumentException(ME
+ ": getException() is called without having an exception");
}
MsgUnitRaw msg = (MsgUnitRaw) msgVec.elementAt(0);
if (msg.getContent() == null || msg.getContent().length == 0) {
// For example when using XmlInterpreter
// <qos><state id='ERROR' info='communication'/></qos>
ErrorCode errorCode = ErrorCode.INTERNAL; // default setting
try{
// See serialization in XmlScriptInterpreter.java
StatusQosData data = glob.getStatusQosFactory().readObject(msg.getQos());
errorCode = ErrorCode.toErrorCode(data.getStateInfo());
}
catch (Throwable e) {
log.severe("Unexpected exception markup in: '" + msg.getQos() + "': " + e.toString());
}
XmlBlasterException e = new XmlBlasterException(glob, errorCode, ME, "");
e.isServerSide(!glob.isServerSide()); // mark to be from the other side
return e;
}
return XmlBlasterException.parseByteArr(glob, msg.getContent(), ErrorCode.USER_UPDATE_INTERNALERROR);
}