Skip to content

Commit

Permalink
Display an error notification rather than throwing an exception
Browse files Browse the repository at this point in the history
refs #8241
  • Loading branch information
Al2Klimov committed May 19, 2015
1 parent 36713fb commit cc050ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Icinga/Web/Widget/FilterEditor.php
Expand Up @@ -10,6 +10,7 @@
use Icinga\Web\Url;
use Icinga\Application\Icinga;
use Icinga\Exception\ProgrammingError;
use Icinga\Web\Notification;
use Exception;

/**
Expand Down Expand Up @@ -217,7 +218,8 @@ public function handleRequest($request)
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));
Expand Down

0 comments on commit cc050ed

Please sign in to comment.