mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Display an error notification rather than throwing an exception
refs #8241
This commit is contained in:
parent
36713fb519
commit
cc050ed696
@ -10,6 +10,7 @@ use Icinga\Data\Filter\FilterOr;
|
|||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
use Icinga\Application\Icinga;
|
use Icinga\Application\Icinga;
|
||||||
use Icinga\Exception\ProgrammingError;
|
use Icinga\Exception\ProgrammingError;
|
||||||
|
use Icinga\Web\Notification;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -217,7 +218,8 @@ class FilterEditor extends AbstractWidget
|
|||||||
if ($search !== null) {
|
if ($search !== null) {
|
||||||
if ($this->searchColumns === null) {
|
if ($this->searchColumns === null) {
|
||||||
if (strpos($search, '=') === false) {
|
if (strpos($search, '=') === false) {
|
||||||
throw new Exception('Cannot search here');
|
Notification::error(mt('monitoring', 'Cannot search here'));
|
||||||
|
return $this;
|
||||||
} else {
|
} else {
|
||||||
list($k, $v) = preg_split('/=/', $search);
|
list($k, $v) = preg_split('/=/', $search);
|
||||||
$filter = $this->mergeRootExpression($filter, trim($k), '=', ltrim($v));
|
$filter = $this->mergeRootExpression($filter, trim($k), '=', ltrim($v));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user