void (Project project, LibraryEx library) { try { deleteAndReloadDependencies(project, library).onError(e -> { showBalloon(JavaUiBundle.message("popup.reload.failed.result", library.getName()), MessageType.ERROR); }).onSuccess(roots -> { showBalloon(JavaUiBundle.message("popup.reload.success.result", library.getName()), MessageType.INFO); }); } catch (IOException | UnsupportedOperationException e) { var error = e.getLocalizedMessage(); showBalloon(error, MessageType.ERROR); } }