catching email exceptions
This commit is contained in:
parent
c09f7a534e
commit
372091fd42
|
@ -486,8 +486,7 @@ LOGGER.debug("json: " + jsonArray);
|
|||
}
|
||||
|
||||
@Override
|
||||
public Repository addRepository(String datatype,
|
||||
Repository repository) throws Exception {
|
||||
public Repository addRepository(String datatype, Repository repository) throws Exception {
|
||||
|
||||
LOGGER.debug("storing " + datatype + " repository with id: " + repository.getId());
|
||||
|
||||
|
@ -558,14 +557,16 @@ LOGGER.debug("json: " + jsonArray);
|
|||
ResponseEntity responseEntity = restTemplate.exchange(uriComponents.toUri(), HttpMethod.POST, httpEntity, ResponseEntity.class);
|
||||
|
||||
if (responseEntity.getStatusCode().equals(HttpStatus.OK)) {
|
||||
emailUtils.sendUserRegistrationEmail(repository, authentication);
|
||||
emailUtils.sendAdminRegistrationEmail(repository, authentication);
|
||||
try {
|
||||
emailUtils.sendUserRegistrationEmail(repository, authentication);
|
||||
emailUtils.sendAdminRegistrationEmail(repository, authentication);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Error sending email", e);
|
||||
}
|
||||
} else
|
||||
LOGGER.debug(responseEntity.getBody().toString());
|
||||
LOGGER.error("Error storing repository: " + responseEntity.getBody().toString());
|
||||
|
||||
return repository;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue