ConfigHealthItemRenderer: be fail-safe

Icinga Web 2 should catch errors, but seems that it doesn't
This commit is contained in:
Thomas Gelf 2018-06-08 16:39:34 +02:00
parent a95618f283
commit ea8452d0e9

View File

@ -22,7 +22,14 @@ class ConfigHealthItemRenderer extends BadgeNavigationItemRenderer
protected function hasProblems() protected function hasProblems()
{ {
$this->checkHealth(); try {
$this->checkHealth();
} catch (Exception $e) {
$this->directorState = self::STATE_UNKNOWN;
$this->count = 1;
$this->message = $e->getMessage();
}
return $this->count > 0; return $this->count > 0;
} }