From fa4aebd7805d16be4112a8aff1226c55b0611721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Theodor=20Angerg=C3=A5rd?= Date: Tue, 25 Jun 2024 20:31:06 +0200 Subject: [PATCH] Update --- .../adapter/secondary/mail/GotifyMailService.java | 10 ++++++---- .../resources/templates/home/edited-me-avatar.html | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/it/chalmers/gamma/adapter/secondary/mail/GotifyMailService.java b/app/src/main/java/it/chalmers/gamma/adapter/secondary/mail/GotifyMailService.java index 6ed6bedc5..49a0c95ac 100644 --- a/app/src/main/java/it/chalmers/gamma/adapter/secondary/mail/GotifyMailService.java +++ b/app/src/main/java/it/chalmers/gamma/adapter/secondary/mail/GotifyMailService.java @@ -8,11 +8,11 @@ import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.web.authentication.WebAuthenticationDetails; import org.springframework.stereotype.Service; +import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; @Service @@ -62,8 +62,10 @@ record Request(String to, String from, String subject, String body) {} HttpEntity entity = new HttpEntity<>(request, headers); RestTemplate restTemplate = new RestTemplate(); - ResponseEntity response = - restTemplate.postForEntity(this.gotifyURL + "/mail", entity, String.class); - LOGGER.info("Gotify responded with " + response.getHeaders() + response.getBody()); + try { + restTemplate.postForEntity(this.gotifyURL + "/mail", entity, String.class); + } catch (RestClientException e) { + LOGGER.error(e.getMessage()); + } } } diff --git a/app/src/main/resources/templates/home/edited-me-avatar.html b/app/src/main/resources/templates/home/edited-me-avatar.html index 6e886b972..2bbfe4df9 100644 --- a/app/src/main/resources/templates/home/edited-me-avatar.html +++ b/app/src/main/resources/templates/home/edited-me-avatar.html @@ -1,2 +1,2 @@ -
+
\ No newline at end of file