From 27fd7c3fefad803c4947be33c3ee42d76edb7190 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 24 Feb 2017 10:36:22 +0000 Subject: [PATCH] Fixed exception management git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-client@144242 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../proxy/ResourceRegistryClientImpl.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/client/proxy/ResourceRegistryClientImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/client/proxy/ResourceRegistryClientImpl.java index b64702a..cba9d60 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/client/proxy/ResourceRegistryClientImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/client/proxy/ResourceRegistryClientImpl.java @@ -73,7 +73,9 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient { ERType erType = delegate.make(call); logger.info("Got {} with UUID {} is {}", type, uuid, erType); return erType; - + } catch (ResourceRegistryException e) { + logger.error("Error while getting {} with UUID {}", type, uuid, e); + throw e; } catch (Exception e) { logger.error("Error while getting {} with UUID {}", type, uuid, e); throw new ResourceRegistryException(e); @@ -107,7 +109,10 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient { logger.info("Got instances of {} are {}", type, ret); return ISMapper.unmarshalList(Entity.class, ret); - + + } catch (ResourceRegistryException e) { + logger.error("Error while getting {} instances", type, e); + throw e; } catch (Exception e) { logger.error("Error while getting {} instances", type, e); throw new ResourceRegistryException(e); @@ -146,7 +151,10 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient { reference.toString(), ret); return ISMapper.unmarshalList(Resource.class, ret); - + + } catch (ResourceRegistryException e) { + logger.error("Error while getting instances of {} from/to {}", relationType, e); + throw e; } catch (Exception e) { logger.error("Error while getting instances of {} from/to {}", relationType, e); throw new ResourceRegistryException(e); @@ -181,7 +189,12 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient { logger.info("Got schema for {} is {}", type, schema); return TypeBinder.deserializeTypeDefinitions(schema); - + + } catch (SchemaNotFoundException e) { + logger.error("Error while getting {}schema for {}", + polymorphic ? AccessPath.POLYMORPHIC_PARAM + " " : "", + type, e); + throw e; } catch (Exception e) { logger.error("Error while getting {}schema for {}", polymorphic ? AccessPath.POLYMORPHIC_PARAM + " " : "",