18
18
*/
19
19
20
20
/*
21
- * Copyright (c) 2011, 2019 , Oracle and/or its affiliates. All rights reserved.
21
+ * Copyright (c) 2011, 2021 , Oracle and/or its affiliates. All rights reserved.
22
22
* Portions Copyright (c) 2011, Jens Elkner.
23
23
* Portions Copyright (c) 2017, 2020, Chris Fraire <[email protected] >.
24
24
*/
@@ -314,12 +314,14 @@ public SearchHelper prepareExec(SortedSet<String> projects) {
314
314
// We use MultiReader even for single project. This should
315
315
// not matter given that MultiReader is just a cheap wrapper
316
316
// around set of IndexReader objects.
317
- reader = RuntimeEnvironment .getInstance ().getMultiReader (
318
- projects , searcherList );
317
+ reader = RuntimeEnvironment .getInstance ().getMultiReader (projects , searcherList );
319
318
if (reader != null ) {
320
319
searcher = new IndexSearcher (reader );
321
320
} else {
322
- errorMsg = "Failed to initialize search. Check the index." ;
321
+ errorMsg = "Failed to initialize search. Check the index" ;
322
+ if (projects .size () > 0 ) {
323
+ errorMsg = errorMsg + " for projects: " + String .join (", " , projects );
324
+ }
323
325
return this ;
324
326
}
325
327
}
@@ -344,8 +346,11 @@ public SearchHelper prepareExec(SortedSet<String> projects) {
344
346
} catch (ParseException e ) {
345
347
errorMsg = PARSE_ERROR_MSG + e .getMessage ();
346
348
} catch (FileNotFoundException e ) {
347
- // errorMsg = "Index database(s) not found: " + e.getMessage();
348
- errorMsg = "Index database(s) not found." ;
349
+ errorMsg = "Index database not found" ;
350
+ if (projects .size () > 0 ) {
351
+ errorMsg = errorMsg + " for projects: " + String .join (", " , projects );
352
+ }
353
+ errorMsg = errorMsg + " " + e .getMessage ();
349
354
} catch (IOException e ) {
350
355
errorMsg = e .getMessage ();
351
356
}
0 commit comments