Search in sources :

Example 1 with CustomResponseErrorHandler

use of uk.ac.ebi.spot.goci.exception.CustomResponseErrorHandler in project goci by EBISPOT.

the class EnsemblRestTemplateService method getRestTemplate.

public RestTemplate getRestTemplate() {
    // Create a new RestTemplate instance
    RestTemplate restTemplate = new RestTemplate();
    restTemplate.setErrorHandler(new CustomResponseErrorHandler());
    // Add the Jackson message converter
    restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
    return restTemplate;
}
Also used : MappingJackson2HttpMessageConverter(org.springframework.http.converter.json.MappingJackson2HttpMessageConverter) CustomResponseErrorHandler(uk.ac.ebi.spot.goci.exception.CustomResponseErrorHandler) RestTemplate(org.springframework.web.client.RestTemplate)

Aggregations

MappingJackson2HttpMessageConverter (org.springframework.http.converter.json.MappingJackson2HttpMessageConverter)1 RestTemplate (org.springframework.web.client.RestTemplate)1 CustomResponseErrorHandler (uk.ac.ebi.spot.goci.exception.CustomResponseErrorHandler)1