WebAppInitializer: Include invalid index.type in exception message
When index.type is configured with an invalid value, IllegalStateException is raised but does not mention what the invalid value is. Add the index.type to the message. Change-Id: I35171b2dd4c5dc8c7afeaed2fe38509f6ad5b440
This commit is contained in:
@@ -45,6 +45,7 @@ import com.google.gerrit.server.git.LocalDiskRepositoryManager;
|
||||
import com.google.gerrit.server.git.ReceiveCommitsExecutorModule;
|
||||
import com.google.gerrit.server.git.WorkQueue;
|
||||
import com.google.gerrit.server.index.IndexModule;
|
||||
import com.google.gerrit.server.index.IndexModule.IndexType;
|
||||
import com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier;
|
||||
import com.google.gerrit.server.mail.SmtpEmailSender;
|
||||
import com.google.gerrit.server.mime.MimeUtil2Module;
|
||||
@@ -299,12 +300,13 @@ public class WebAppInitializer extends GuiceServletContextListener
|
||||
modules.add(new RestCacheAdminModule());
|
||||
modules.add(new GpgModule(config));
|
||||
AbstractModule changeIndexModule;
|
||||
switch (IndexModule.getIndexType(cfgInjector)) {
|
||||
IndexType indexType = IndexModule.getIndexType(cfgInjector);
|
||||
switch (indexType) {
|
||||
case LUCENE:
|
||||
changeIndexModule = new LuceneIndexModule();
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException("unsupported index.type");
|
||||
throw new IllegalStateException("unsupported index.type = " + indexType);
|
||||
}
|
||||
modules.add(changeIndexModule);
|
||||
modules.add(new CanonicalWebUrlModule() {
|
||||
|
Reference in New Issue
Block a user