From ef5684b07f4f23d4fa9bc89f3320a55629add8ae Mon Sep 17 00:00:00 2001 From: southeo Date: Mon, 9 Dec 2024 16:56:25 +0100 Subject: [PATCH] fix 1.0 --- .../core/datacitepublisher/component/XmlLocReader.java | 1 + .../core/datacitepublisher/kafka/KafkaConsumerService.java | 6 +++--- .../datacitepublisher/service/DataCitePublisherService.java | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/dissco/core/datacitepublisher/component/XmlLocReader.java b/src/main/java/eu/dissco/core/datacitepublisher/component/XmlLocReader.java index 20f7f14..cf8c86e 100644 --- a/src/main/java/eu/dissco/core/datacitepublisher/component/XmlLocReader.java +++ b/src/main/java/eu/dissco/core/datacitepublisher/component/XmlLocReader.java @@ -59,5 +59,6 @@ static class LocationXml { String href; String id; String weight; + String view; } } diff --git a/src/main/java/eu/dissco/core/datacitepublisher/kafka/KafkaConsumerService.java b/src/main/java/eu/dissco/core/datacitepublisher/kafka/KafkaConsumerService.java index 9045598..6b9202c 100644 --- a/src/main/java/eu/dissco/core/datacitepublisher/kafka/KafkaConsumerService.java +++ b/src/main/java/eu/dissco/core/datacitepublisher/kafka/KafkaConsumerService.java @@ -28,7 +28,7 @@ public class KafkaConsumerService { @Qualifier("objectMapper") private final ObjectMapper mapper; private final DataCitePublisherService service; - private static final String ERROR_MSG = "Unable to parse specimen event from the handle API"; + private static final String ERROR_MSG = "Unable to parse {} event from the handle API"; @RetryableTopic( attempts = "1", @@ -39,7 +39,7 @@ public void getSpecimenMessages(@Payload String message) throws DataCiteApiExcep var event = mapper.readValue(message, DigitalSpecimenEvent.class); service.handleMessages(event); } catch (JsonProcessingException e) { - log.error(ERROR_MSG, e); + log.error(ERROR_MSG, "specimen", e); log.info("Message: {}", message); throw new InvalidRequestException(); } @@ -54,7 +54,7 @@ public void getMediaMessages(@Payload String message) throws DataCiteApiExceptio var event = mapper.readValue(message, DigitalMediaEvent.class); service.handleMessages(event); } catch (JsonProcessingException e) { - log.error(ERROR_MSG); + log.error(ERROR_MSG, "media", e); log.info("Message: {}", message); throw new InvalidRequestException(); } diff --git a/src/main/java/eu/dissco/core/datacitepublisher/service/DataCitePublisherService.java b/src/main/java/eu/dissco/core/datacitepublisher/service/DataCitePublisherService.java index 88a355e..eaedfd6 100644 --- a/src/main/java/eu/dissco/core/datacitepublisher/service/DataCitePublisherService.java +++ b/src/main/java/eu/dissco/core/datacitepublisher/service/DataCitePublisherService.java @@ -181,6 +181,7 @@ private DcRequest buildDcRequest(String xmlLoc, String landingPage, String altId .build() ).build(); } catch (InvalidFdoProfileReceivedException e) { + log.error("Unable to parse Fdo Profile", e); throw new DataCiteMappingException(); } }