fix for exception not getting caught
@@ -71,20 +71,22 @@ public class CatalogMetadataConfig {
@Bean
public PostMetadataConfigAction connectorPluginSyncAction(ConnectorPluginManager pluginMgr, MetadataAccess metadata) {
+ return () -> {
try {
- return doPluginSyncAction(pluginMgr, metadata);
+ doPluginSyncAction(pluginMgr, metadata);
} catch (ConnectorAlreadyExistsException e) {
log.warn("Encountered an error attempting to synchronize plugins", e);
log.info("Rebuilding modeshape indexes to ensure the are accurately synchronized with the data. Please be patient as this may take a long time!");
try {
reindex(metadata);
- return doPluginSyncAction(pluginMgr, metadata);
+ doPluginSyncAction(pluginMgr, metadata);
} catch (ConnectorAlreadyExistsException e2) {
log.error("Unrecoverable fatal exception. Encountered connector already exists after synchronizing modeshape indexes", e2);
throw e2;
}
}
+ };
}
@@ -98,8 +100,7 @@ public class CatalogMetadataConfig {
}
- private PostMetadataConfigAction doPluginSyncAction(ConnectorPluginManager pluginMgr, MetadataAccess metadata) {
- return () -> {
+ private void doPluginSyncAction(ConnectorPluginManager pluginMgr, MetadataAccess metadata) {
metadata.commit(() -> {
List<ConnectorPlugin> plugins = pluginMgr.getPlugins();
Map<String, Connector> connectorMap = connectorProvider().findAll(true).stream().collect(Collectors.toMap(Connector::getPluginId, c -> c));
@@ -133,6 +134,5 @@ public class CatalogMetadataConfig {
}
}
}, MetadataAccess.SERVICE);
- };
}
}
