diff --git a/module/VuFind/src/VuFind/Controller/AbstractSearch.php b/module/VuFind/src/VuFind/Controller/AbstractSearch.php index cd1fd8f1984ce66a9a74dbb6f06933f2beb9cc94..1adb027f0103fa287f44d6d164d208caa5fad8da 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractSearch.php +++ b/module/VuFind/src/VuFind/Controller/AbstractSearch.php @@ -234,17 +234,19 @@ class AbstractSearch extends AbstractBase if ($this->resultScrollerActive()) { $this->resultScroller()->init($results); } - } catch (\VuFindSearch\Backend\Exception\RequestParseErrorException $e) { - // If it's a parse error or the user specified an invalid field, we - // should display an appropriate message: - $view->parseError = true; - - // We need to create and process an "empty results" object to - // ensure that recommendation modules and templates behave - // properly when displaying the error message. - $view->results = $this->getResultsManager()->get('EmptySet'); - $view->results->setParams($params); - $view->results->performAndProcessSearch(); + } catch (\VuFindSearch\Backend\Exception\BackendException $e) { + if ($e->hasTag('VuFind\Search\ParserError')) { + // If it's a parse error or the user specified an invalid field, we + // should display an appropriate message: + $view->parseError = true; + + // We need to create and process an "empty results" object to + // ensure that recommendation modules and templates behave + // properly when displaying the error message. + $view->results = $this->getResultsManager()->get('EmptySet'); + $view->results->setParams($params); + $view->results->performAndProcessSearch(); + } } // Save statistics: if ($this->logStatistics) { diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Exception/RequestParseErrorException.php b/module/VuFindSearch/src/VuFindSearch/Backend/Exception/RequestParseErrorException.php deleted file mode 100644 index 2d61d981c6a592e8c4e89b16c2d33a143df1a00e..0000000000000000000000000000000000000000 --- a/module/VuFindSearch/src/VuFindSearch/Backend/Exception/RequestParseErrorException.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/** - * RequestParseErrorException. - * - * PHP version 5 - * - * Copyright (C) Villanova University 2010. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @category VuFind2 - * @package Search - * @author David Maus <maus@hab.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org - */ - -namespace VuFindSearch\Backend\Exception; - -/** - * RequestParseErrorException. - * - * Signals an error parsing the syntax of the user-supplied search criteria. - * - * @category VuFind2 - * @package Search - * @author David Maus <maus@hab.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org - */ -class RequestParseErrorException extends RequestErrorException -{ -}