mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-01 04:59:25 -06:00
Catch exception
This commit is contained in:
parent
ad8a8ae612
commit
0518c96567
@ -54,6 +54,7 @@ use Gdbots\QueryParser\QueryParser;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use TypeError;
|
||||
|
||||
/**
|
||||
* Class OperatorQuerySearch
|
||||
@ -152,7 +153,13 @@ class OperatorQuerySearch implements SearchInterface
|
||||
{
|
||||
Log::debug(sprintf('Now in parseQuery(%s)', $query));
|
||||
$parser = new QueryParser();
|
||||
$query1 = $parser->parse($query);
|
||||
try {
|
||||
$query1 = $parser->parse($query);
|
||||
} catch (TypeError $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error(sprintf('Could not parse search: "%s".', $query));
|
||||
throw new FireflyException('Invalid search value. See the logs.', 0, $e);
|
||||
}
|
||||
|
||||
Log::debug(sprintf('Found %d node(s)', count($query1->getNodes())));
|
||||
foreach ($query1->getNodes() as $searchNode) {
|
||||
|
Loading…
Reference in New Issue
Block a user