process/show: failsafe process rendering

This commit is contained in:
Thomas Gelf 2016-11-28 00:49:46 +01:00
parent 281b3286bd
commit f09a246392

View file

@ -51,7 +51,20 @@ use Icinga\Module\Businessprocess\BusinessProcess;
</ul>
<?php endif ?>
<div id="<?= $this->bp->getHtmlId() ?>" class="bp">
<?= $this->bp->renderHtml($this) ?>
<?php
try {
echo $this->bp->renderHtml($this);
} catch (Exception $e) {
printf(
'<ul class="error"><li>%s: %s</li></ul>',
$this->translate('Error'),
$this->escape($e->getMessage())
);
}
?>
<?php if (! $this->bpconfig->isLocked()): ?>
<?php if ($this->bp instanceof BusinessProcess): /* do not render when showing subtree */ ?>
<?= $this->bp->renderUnbound($this) ?>