Added a custom exception of kind ZenodoException

This commit is contained in:
Francesco Mangiacrapa 2020-02-07 11:15:22 +01:00
parent 5917f8de5e
commit 3b5d414e31
1 changed files with 7 additions and 0 deletions

View File

@ -165,8 +165,15 @@ public class CkanToZenodoPublisherServiceImpl extends RemoteServiceServlet imple
zenodoItem.setName(item.getItemId());
LOG.debug("Returning item: "+zenodoItem);
return zenodoItem;
} catch (ZenodoException e) {
String error = ZenodoException.class.getSimpleName()+" on converting the catalogue item with id: "+item.getItemId();
LOG.error(error, e);
String clientError = String.format("%s. %s", error, e.getMessage());
throw new Exception(clientError);
} catch (Exception e) {
String error = "Error on converting the catalogue item with id: "+item.getItemId();
LOG.error(error, e);