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
This commit is contained in:
Luca Frosini 2017-02-24 10:36:22 +00:00
parent 4473b8e201
commit 27fd7c3fef
1 changed files with 17 additions and 4 deletions

View File

@ -73,7 +73,9 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
ERType erType = delegate.make(call); ERType erType = delegate.make(call);
logger.info("Got {} with UUID {} is {}", type, uuid, erType); logger.info("Got {} with UUID {} is {}", type, uuid, erType);
return erType; return erType;
} catch (ResourceRegistryException e) {
logger.error("Error while getting {} with UUID {}", type, uuid, e);
throw e;
} catch (Exception e) { } catch (Exception e) {
logger.error("Error while getting {} with UUID {}", type, uuid, e); logger.error("Error while getting {} with UUID {}", type, uuid, e);
throw new ResourceRegistryException(e); throw new ResourceRegistryException(e);
@ -107,7 +109,10 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
logger.info("Got instances of {} are {}", type, ret); logger.info("Got instances of {} are {}", type, ret);
return ISMapper.unmarshalList(Entity.class, ret); return ISMapper.unmarshalList(Entity.class, ret);
} catch (ResourceRegistryException e) {
logger.error("Error while getting {} instances", type, e);
throw e;
} catch (Exception e) { } catch (Exception e) {
logger.error("Error while getting {} instances", type, e); logger.error("Error while getting {} instances", type, e);
throw new ResourceRegistryException(e); throw new ResourceRegistryException(e);
@ -146,7 +151,10 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
reference.toString(), ret); reference.toString(), ret);
return ISMapper.unmarshalList(Resource.class, 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) { } catch (Exception e) {
logger.error("Error while getting instances of {} from/to {}", relationType, e); logger.error("Error while getting instances of {} from/to {}", relationType, e);
throw new ResourceRegistryException(e); throw new ResourceRegistryException(e);
@ -181,7 +189,12 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
logger.info("Got schema for {} is {}", type, schema); logger.info("Got schema for {} is {}", type, schema);
return TypeBinder.deserializeTypeDefinitions(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) { } catch (Exception e) {
logger.error("Error while getting {}schema for {}", logger.error("Error while getting {}schema for {}",
polymorphic ? AccessPath.POLYMORPHIC_PARAM + " " : "", polymorphic ? AccessPath.POLYMORPHIC_PARAM + " " : "",