Fixing logs

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-client@146916 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-04-18 08:54:18 +00:00
parent cccb7dc18f
commit 442896a509
1 changed files with 15 additions and 21 deletions

View File

@ -73,8 +73,10 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
logger.debug("{} with UUID {} exists", type, uuid);
} catch (ResourceRegistryException e) {
//logger.trace("Error while checking if {} with UUID {} exists.", type, uuid, e);
throw e;
} catch (Exception e) {
//logger.trace("Error while checking if {} with UUID {} exists.", type, uuid, e);
throw new RuntimeException(e);
}
}
@ -101,10 +103,10 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
logger.debug("Got {} with UUID {} is {}", type, uuid, erType);
return erType;
} catch (ResourceRegistryException e) {
logger.error("Error while getting {} with UUID {}", type, uuid, e);
//logger.trace("Error while getting {} with UUID {}", type, uuid, e);
throw e;
} catch (Exception e) {
logger.error("Error while getting {} with UUID {}", type, uuid, e);
//logger.trace("Error while getting {} with UUID {}", type, uuid, e);
throw new RuntimeException(e);
}
}
@ -128,14 +130,12 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
String ret = httpCall.call(String.class, stringWriter.toString(), HTTPMETHOD.GET, parameters);
logger.debug("Got instances of {} are {}", type, ret);
return ISMapper.unmarshalList(Entity.class, ret);
} catch (ResourceRegistryException e) {
logger.error("Error while getting {} instances", type, e);
//logger.trace("Error while getting {} instances", type, e);
throw e;
} catch (Exception e) {
logger.error("Error while getting {} instances", type, e);
//logger.trace("Error while getting {} instances", type, e);
throw new RuntimeException(e);
}
}
@ -162,14 +162,12 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
String ret = httpCall.call(String.class, stringWriter.toString(), HTTPMETHOD.GET, parameters);
logger.debug("Got instances of {} from/to {} are {}", relationType, reference.toString(), ret);
return ISMapper.unmarshalList(Resource.class, ret);
} catch (ResourceRegistryException e) {
logger.error("Error while getting instances of {} from/to {}", relationType, e);
//logger.trace("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);
//logger.trace("Error while getting instances of {} from/to {}", relationType, e);
throw new RuntimeException(e);
}
}
@ -196,16 +194,14 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
String schema = httpCall.call(String.class, stringWriter.toString(), HTTPMETHOD.GET, parameters);
logger.debug("Got schema for {} is {}", type, schema);
return TypeBinder.deserializeTypeDefinitions(schema);
} catch (ResourceRegistryException e) {
logger.error("Error while getting {}schema for {}", polymorphic ? AccessPath.POLYMORPHIC_PARAM + " " : "",
type, e);
//logger.trace("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 + " " : "",
type, e);
//logger.trace("Error while getting {}schema for {}", polymorphic ? AccessPath.POLYMORPHIC_PARAM + " " : "",
// type, e);
throw new RuntimeException(e);
}
}
@ -215,7 +211,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
throws InvalidQueryException, ResourceRegistryException {
try {
logger.debug("Going to query. {}", query);
logger.info("Going to query. {}", query);
StringWriter stringWriter = new StringWriter();
stringWriter.append(PATH_SEPARATOR);
stringWriter.append(AccessPath.ACCESS_PATH_PART);
@ -235,14 +231,12 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
String ret = httpCall.call(String.class, stringWriter.toString(), HTTPMETHOD.GET, parameters);
logger.debug("Query result is {}", ret);
return ret;
} catch (ResourceRegistryException e) {
logger.error("Error while querying", e);
//logger.trace("Error while querying", e);
throw e;
} catch (Exception e) {
logger.error("Error while querying", e);
//logger.trace("Error while querying", e);
throw new RuntimeException(e);
}
}