Bug 18897: Improve error message

Test Plan:
$ git fetch
$ git checkout -b bug_18897 origin/master
$ git bz apply 18897
-- interactive apply just the first patch
$ sudo apt-get remove libcatmandu-store-elasticsearch-perl
...
$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t
-- Note that the message says the wrong library is missing.
$ git bz apply 18897
-- interactive apply this patch
$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t
-- Note that the message says the correct library is missing.
run the koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a24ac20670)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Mark Tompsett 2017-08-25 07:38:06 -04:00 committed by Katrin Fischer
parent ecc6542c8c
commit 82db13b711
1 changed files with 5 additions and 1 deletions

View File

@ -29,7 +29,11 @@ my $schema = Koha::Database->schema();
eval { require Koha::SearchEngine::Elasticsearch::Indexer; };
if ( $@ ) {
my $es_dep_msg = "Required module Catmandu::Importer::MARC is not installed";
my $missing_module;
if ( $@ =~ /Can\'t locate (.*?) / ) {
$missing_module = $1;
}
my $es_dep_msg = "Required module $missing_module is not installed";
plan( skip_all => $es_dep_msg );
}
else {