Module (final ModuleBuilder builder) { try { return ApplicationManager.getApplication().runWriteAction( (ThrowableComputable<Module, Exception>)() -> builder.createModule(myModuleModel)); } catch (Exception e) { LOG.error(JavaUiBundle.message("module.add.error.message", e.getMessage()), e); Messages.showErrorDialog(JavaUiBundle.message("module.add.error.message", e.getMessage()), JavaUiBundle.message("module.add.error.title")); return null; } }