Project

General

Profile

« Previous | Next » 

Revision 56339

catch exception thrown by rest service

View differences:

modules/dnet-directindex-api/trunk/src/main/java/eu/dnetlib/openaire/directindex/api/OpenAIRESubmitterUtils.java
10 10
import eu.dnetlib.miscutils.functional.hash.Hashing;
11 11
import eu.dnetlib.openaire.directindex.objects.ZenodoContextList;
12 12
import org.apache.commons.lang.StringUtils;
13
import org.springframework.web.client.RestClientException;
13 14
import org.springframework.web.client.RestTemplate;
14 15

  
15 16
/**
......
162 163
			Set<String> zenodoOpenAIRE = new HashSet<>();
163 164
			for (String context: zenodoContexts){
164 165
				//String ct = context.substring(context.lastIndexOf("/")+1);
165
				zenodoOpenAIRE.addAll(rt.getForObject(community_api +context+"/openairecommunities", ZenodoContextList.class).getOpenAirecommunitylist());
166
				try{
167
					zenodoOpenAIRE.addAll(rt.getForObject(community_api +context+"/openairecommunities", ZenodoContextList.class).getOpenAirecommunitylist());
168
				}catch(RestClientException rce){
169
					log.error("Anable to get object for " + community_api +context+"/openairecommunities");
170
				}
166 171

  
172

  
167 173
			}
168 174
			contexts.addAll(zenodoOpenAIRE);
169 175
		}

Also available in: Unified diff