return new ModuleConfigImpl(moduleDefinition, classLoadingConfig, moduleSource);
} catch (Throwable e) {
if (moduleSource != null) {
try {
moduleSource.dispose();
} catch (Throwable e2) {
log.error("Error disposing module source for file " + moduleDefinition.getFile().getAbsolutePath(), e2);
}
}