From 4f42387f859c430ff93b8a0638f22e45b3f45b17 Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Thu, 23 Nov 2017 11:40:35 +0000 Subject: [PATCH] Fixing log git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@158785 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../resourceregistry/er/ERManagement.java | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java index 2ca7fcf..e905738 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/er/ERManagement.java @@ -440,8 +440,10 @@ public abstract class ERManagement { return true; } catch (ResourceRegistryException e) { + logger.error("Unable to find {} with UUID {}", accessType.getName(), uuid); throw e; } catch (Exception e) { + logger.error("Unable to find {} with UUID {}", accessType.getName(), uuid, e); throw new ResourceRegistryException(e); } finally { if (orientGraph != null) { @@ -464,11 +466,13 @@ public abstract class ERManagement { return serialize(); } catch (ResourceRegistryException e) { + logger.error("Unable to create {}", accessType.getName()); if (orientGraph != null) { orientGraph.rollback(); } throw e; } catch (Exception e) { + logger.error("Unable to create {}", accessType.getName(), e); if (orientGraph != null) { orientGraph.rollback(); } @@ -490,8 +494,10 @@ public abstract class ERManagement { return serialize(); } catch (ResourceRegistryException e) { + logger.error("Unable to read {} with UUID {}", accessType.getName(), uuid); throw e; } catch (Exception e) { + logger.error("Unable to read {} with UUID {}", accessType.getName(), uuid, e); throw new ResourceRegistryException(e); } finally { if (orientGraph != null) { @@ -517,11 +523,13 @@ public abstract class ERManagement { // TODO Serialized resource is the old version. This really strange and should be an orient bug } catch (ResourceRegistryException e) { + logger.error("Unable to update {} with UUID {}", accessType.getName(), uuid); if (orientGraph != null) { orientGraph.rollback(); } throw e; } catch (Exception e) { + logger.error("Unable to update {} with UUID {}", accessType.getName(), uuid, e); if (orientGraph != null) { orientGraph.rollback(); } @@ -557,7 +565,7 @@ public abstract class ERManagement { return deleted; } catch (ResourceRegistryException e) { - logger.error("Unable to delete {} with UUID {}", accessType.getName(), uuid, e); + logger.error("Unable to delete {} with UUID {}", accessType.getName(), uuid); if (orientGraph != null) { orientGraph.rollback(); } @@ -575,7 +583,7 @@ public abstract class ERManagement { } } - public boolean addToContext() throws ERNotFoundException, ContextException { + public boolean addToContext() throws ERNotFoundException, ContextException, ResourceRegistryException { logger.debug("Going to add {} with UUID {} to actual Context", accessType.getName(), uuid); @@ -590,6 +598,13 @@ public abstract class ERManagement { accessType.getName(), uuid); return added; + } catch (ResourceRegistryException e) { + logger.error("Unable to add {} with UUID {} to actual Context", + accessType.getName(), uuid); + if (orientGraph != null) { + orientGraph.rollback(); + } + throw e; } catch (Exception e) { logger.error("Unable to add {} with UUID {} to actual Context", accessType.getName(), uuid, e); @@ -604,7 +619,7 @@ public abstract class ERManagement { } } - public boolean removeFromContext() throws ERNotFoundException, ContextException { + public boolean removeFromContext() throws ERNotFoundException, ContextException, ResourceRegistryException { logger.debug("Going to remove {} with UUID {} from actual Context", accessType.getName(), uuid); @@ -620,6 +635,13 @@ public abstract class ERManagement { accessType.getName(), uuid); return removed; + } catch (ResourceRegistryException e) { + logger.error("Unable to remove {} with UUID {} from actual Context", + accessType.getName(), uuid); + if (orientGraph != null) { + orientGraph.rollback(); + } + throw e; } catch (Exception e) { logger.error( "Unable to remove {} with UUID {} from actual Context",