From cc050ed696fc73ebb4d344bbd1e5f679a18e5e71 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 19 May 2015 16:28:07 +0200 Subject: [PATCH] Display an error notification rather than throwing an exception refs #8241 --- library/Icinga/Web/Widget/FilterEditor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php index fb346b573..07640872b 100644 --- a/library/Icinga/Web/Widget/FilterEditor.php +++ b/library/Icinga/Web/Widget/FilterEditor.php @@ -10,6 +10,7 @@ use Icinga\Data\Filter\FilterOr; use Icinga\Web\Url; use Icinga\Application\Icinga; use Icinga\Exception\ProgrammingError; +use Icinga\Web\Notification; use Exception; /** @@ -217,7 +218,8 @@ class FilterEditor extends AbstractWidget if ($search !== null) { if ($this->searchColumns === null) { if (strpos($search, '=') === false) { - throw new Exception('Cannot search here'); + Notification::error(mt('monitoring', 'Cannot search here')); + return $this; } else { list($k, $v) = preg_split('/=/', $search); $filter = $this->mergeRootExpression($filter, trim($k), '=', ltrim($v));