Skip to content

Commit

Permalink
[UPD] Catch exception and log warning if something goes wrong when ca…
Browse files Browse the repository at this point in the history
…lling external process annotation service.
  • Loading branch information
kostobog committed Jun 28, 2022
1 parent 30943ab commit dbeed3b
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

@Service
@Slf4j
Expand Down Expand Up @@ -53,11 +51,14 @@ public void convertDocument(String docuementIri) throws UnsupportedEncodingExcep
}

public void processAnnotations(){
log.info("calling external annotation processing service {}", conf.getProcessAnnotationAPI());
RestTemplate restTemplate = new RestTemplate();
String url = conf.getProcessAnnotationAPI();
ResponseEntity<String> response
= restTemplate.getForEntity(url, String.class);
try {
log.info("calling external annotation processing service {}", conf.getProcessAnnotationAPI());
RestTemplate restTemplate = new RestTemplate();
String url = conf.getProcessAnnotationAPI();
ResponseEntity<String> response
= restTemplate.getForEntity(url, String.class);
}catch (Exception e){
log.warn("Failed executing external process annotation service at <{}>. Error message - {}", e.getMessage());
}
}

}

0 comments on commit dbeed3b

Please sign in to comment.