LOG.debug(e.getMessage(), e);
prepareErrorDetails(e, context, errorRef, servletPath);
final PersistenceSession checkSession = IsisContext.getPersistenceSession();
final IsisTransactionManager transactionManager = checkSession.getTransactionManager();
if (transactionManager.getTransaction() != null
&& transactionManager.getTransaction().getState().canAbort()) {
transactionManager.abortTransaction();
transactionManager.startTransaction();
}
final Throwable ex = e instanceof TagProcessingException ? e.getCause() : e;
if (ex instanceof ForbiddenException) {
context.addVariable("_security-context", ((TagProcessingException) e).getContext(), Scope.ERROR);