}
private void writeFaultDetail(CougarFault cougarFault, XMLStreamWriter xmlWriter) throws XMLStreamException, JAXBException {
xmlWriter.writeStartElement("detail");
FaultDetail detail = cougarFault.getDetail();
if(detail != null ) {
List<String[]> faultMessages = detail.getFaultMessages();
if (faultMessages != null) {
writeElement("exceptionname", detail.getFaultName(), xmlWriter);
xmlWriter.writeStartElement(detail.getFaultName());
for (String[] msg: faultMessages) {
writeElement(msg[0],msg[1],xmlWriter);
}
xmlWriter.writeEndElement();
}
if (FaultController.getInstance().isDetailedFaults()) {
writeElement("trace",detail.getStackTrace(),xmlWriter);
writeElement("message",detail.getDetailMessage(),xmlWriter);
}
}
xmlWriter.writeEndElement();
}