Uniformed raised exception

This commit is contained in:
Luca Frosini 2021-09-13 12:24:04 +02:00
parent 4e091a25de
commit 323fe367e6
4 changed files with 9 additions and 6 deletions

View File

@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for Resource Registry Context Client
## [v4.0.1-SNAPSHOT]
- Uniformed raised exception [#21993]
## [v4.0.0]

View File

@ -10,7 +10,7 @@
<groupId>org.gcube.information-system</groupId>
<artifactId>resource-registry-context-client</artifactId>
<version>4.0.0</version>
<version>4.0.1-SNAPSHOT</version>
<name>Resource Registry Context Client</name>
<description>Resource Registry Context Client is a library designed to interact with Resource Registry Context APIs</description>

View File

@ -25,9 +25,9 @@ public interface ResourceRegistryContextClient {
public Context readCurrentContext() throws ContextNotFoundException, ResourceRegistryException;
public Context update(Context context) throws ResourceRegistryException;
public Context update(Context context) throws ContextNotFoundException, ResourceRegistryException;
public String update(String context) throws ResourceRegistryException;
public String update(String context) throws ContextNotFoundException, ResourceRegistryException;
public boolean delete(Context context) throws ContextNotFoundException, ResourceRegistryException;

View File

@ -212,7 +212,7 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
}
}
public String internalUpdate(Context context) throws ResourceRegistryException {
public String internalUpdate(Context context) throws ContextNotFoundException, ResourceRegistryException {
try {
String contextString = ElementMapper.marshal(context);
logger.trace("Going to update {}", contextString);
@ -244,7 +244,7 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
}
@Override
public Context update(Context context) throws ResourceRegistryException {
public Context update(Context context) throws ContextNotFoundException, ResourceRegistryException {
try {
String res = internalUpdate(context);
return ElementMapper.unmarshal(Context.class, res);
@ -258,7 +258,7 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
}
@Override
public String update(String context) throws ResourceRegistryException {
public String update(String context) throws ContextNotFoundException, ResourceRegistryException {
try {
Context c = ElementMapper.unmarshal(Context.class, context);
return internalUpdate(c);