use of org.xwiki.rendering.block.VerbatimBlock in project xwiki-platform by xwiki.
the class InternalTemplateManager method generateError.
private XDOM generateError(Throwable throwable) {
List<Block> errorBlocks = new ArrayList<Block>();
// Add short message
Map<String, String> errorBlockParams = Collections.singletonMap("class", "xwikirenderingerror");
errorBlocks.add(new GroupBlock(Arrays.<Block>asList(new WordBlock("Failed to render step content")), errorBlockParams));
// Add complete error
StringWriter writer = new StringWriter();
throwable.printStackTrace(new PrintWriter(writer));
Block descriptionBlock = new VerbatimBlock(writer.toString(), false);
Map<String, String> errorDescriptionBlockParams = Collections.singletonMap("class", "xwikirenderingerrordescription hidden");
errorBlocks.add(new GroupBlock(Arrays.asList(descriptionBlock), errorDescriptionBlockParams));
return new XDOM(errorBlocks);
}
Aggregations