From af8d789d931e74c8d0dd9aa24a45098b742bb762 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Thu, 3 Aug 2017 13:24:45 +0000 Subject: [PATCH] minor bug fix on association group thread git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@152457 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/threads/AssociationToGroupAndNotifyThread.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/threads/AssociationToGroupAndNotifyThread.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/threads/AssociationToGroupAndNotifyThread.java index 92c110e..997b933 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/threads/AssociationToGroupAndNotifyThread.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/threads/AssociationToGroupAndNotifyThread.java @@ -115,11 +115,15 @@ public class AssociationToGroupAndNotifyThread extends Thread { if(groupsForceCreation != null){ logger.info("Groups that must be created before association are " + groupsForceCreation); for (OrganizationBean groupToForce : groupsForceCreation) { + try{ CkanGroup group = catalogue.createGroup(groupToForce.getName(), groupToForce.getTitle(), ""); if(group == null) - logger.warn("Unable to retrieve or create group with name " + group); + logger.error("Unable to retrieve or create group with name " + groupToForce); else groups.add(new OrganizationBean(group.getTitle(), group.getName(), false, groupToForce.isPropagateUp())); + }catch(Exception e){ + logger.error("Failed to check if a group with this info " + groupToForce + " already exists or can be created"); + } } }