Search in sources :

Example 1 with MergeException

use of com.xpn.xwiki.doc.merge.MergeException in project xwiki-platform by xwiki.

the class XWikiDocumentMergeTest method merge.

private MergeResult merge() throws Exception {
    MergeResult result = this.currentDocument.merge(this.previousDocument, this.nextDocument, this.configuration, this.oldcore.getXWikiContext());
    List<LogEvent> exception = result.getLog().getLogs(LogLevel.ERROR);
    if (!exception.isEmpty()) {
        throw new MergeException(exception.get(0).getFormattedMessage(), exception.get(0).getThrowable());
    }
    return result;
}
Also used : LogEvent(org.xwiki.logging.event.LogEvent) MergeException(com.xpn.xwiki.doc.merge.MergeException) MergeResult(com.xpn.xwiki.doc.merge.MergeResult)

Aggregations

MergeException (com.xpn.xwiki.doc.merge.MergeException)1 MergeResult (com.xpn.xwiki.doc.merge.MergeResult)1 LogEvent (org.xwiki.logging.event.LogEvent)1