From 8fb8ae5e95da72772392a051a7af5658928afaeb Mon Sep 17 00:00:00 2001 From: dgiacobbe Date: Fri, 20 Dec 2024 12:26:49 +0100 Subject: [PATCH] P4PADEV-1657 code review --- .../treasury/TreasuryOpiIngestionActivityImpl.java | 6 +++--- .../exception/TreasuryOpiInvalidFileException.java | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/main/java/it/gov/pagopa/payhub/activities/exception/TreasuryOpiInvalidFileException.java diff --git a/src/main/java/it/gov/pagopa/payhub/activities/activity/treasury/TreasuryOpiIngestionActivityImpl.java b/src/main/java/it/gov/pagopa/payhub/activities/activity/treasury/TreasuryOpiIngestionActivityImpl.java index b2342c66..14f93c2d 100644 --- a/src/main/java/it/gov/pagopa/payhub/activities/activity/treasury/TreasuryOpiIngestionActivityImpl.java +++ b/src/main/java/it/gov/pagopa/payhub/activities/activity/treasury/TreasuryOpiIngestionActivityImpl.java @@ -6,6 +6,7 @@ import it.gov.pagopa.payhub.activities.enums.IngestionFlowFileType; import it.gov.pagopa.payhub.activities.exception.IngestionFlowFileNotFoundException; +import it.gov.pagopa.payhub.activities.exception.TreasuryOpiInvalidFileException; import it.gov.pagopa.payhub.activities.service.ingestionflow.IngestionFlowFileRetrieverService; import it.gov.pagopa.payhub.activities.service.treasury.TreasuryUnmarshallerService; @@ -17,7 +18,6 @@ import java.io.IOException; import java.nio.file.Path; import java.util.*; -import java.util.concurrent.atomic.AtomicBoolean; /** * Interface for the TreasuryOpiIngestionActivity. @@ -96,8 +96,8 @@ private List parseData(Path ingestionFlowFilePath) { try { flussoGiornaleDiCassa14 = treasuryUnmarshallerService.unmarshalOpi14(ingestionFlowFile); log.debug("file flussoGiornaleDiCassa with Id {} parsed successfully ", flussoGiornaleDiCassa14.getId()); - } catch (Exception e) { - log.info("file flussoGiornaleDiCassa parsing error with opi 1.4 format {} ", e.getMessage()); + } catch (Exception exception) { + log.info("file flussoGiornaleDiCassa parsing error with opi 1.4 format {} ", exception.getMessage()); throw new TreasuryOpiInvalidFileException("Cannot parse treasury Opi file " + ingestionFlowFile); } } diff --git a/src/main/java/it/gov/pagopa/payhub/activities/exception/TreasuryOpiInvalidFileException.java b/src/main/java/it/gov/pagopa/payhub/activities/exception/TreasuryOpiInvalidFileException.java new file mode 100644 index 00000000..629a97e6 --- /dev/null +++ b/src/main/java/it/gov/pagopa/payhub/activities/exception/TreasuryOpiInvalidFileException.java @@ -0,0 +1,7 @@ +package it.gov.pagopa.payhub.activities.exception; + +public class TreasuryOpiInvalidFileException extends ActivitiesException { + public TreasuryOpiInvalidFileException(String message) { + super(message); + } +}