diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php index 12b0ec042..fbc10fb2d 100644 --- a/application/displayblock.class.inc.php +++ b/application/displayblock.class.inc.php @@ -17,6 +17,7 @@ * You should have received a copy of the GNU Affero General Public License */ +use Combodo\iTop\Application\UI\Component\Alert\AlertFactory; use Combodo\iTop\Application\UI\Component\Badge\BadgeFactory; use Combodo\iTop\Application\UI\Component\Button\ButtonFactory; use Combodo\iTop\Application\UI\Component\Dashlet\DashletFactory; @@ -242,6 +243,14 @@ class DisplayBlock try { $oHtml->AddSubBlock($this->GetRenderContent($oPage, $aExtraParams, $sId)); } catch (Exception $e) { + if (UserRights::IsAdministrator()) { + $sExceptionContent = << +{$e->getMessage()} +HTML; + $oExceptionAlert = AlertFactory::MakeForFailure('Cannot display results', $sExceptionContent); + $oHtml->AddSubBlock($oExceptionAlert); + } IssueLog::Error('Exception during GetDisplay: '.$e->getMessage()); } $oHtml->AddHtml("\n");