From 04d571e8be315c88484c628458bd4e84989fbfc2 Mon Sep 17 00:00:00 2001 From: Marco Meretta Date: Tue, 29 Aug 2023 13:56:22 +0200 Subject: [PATCH] fix log --- src/main/java/it/gov/pagopa/fdrxmltojson/FdrXmlToJson.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/it/gov/pagopa/fdrxmltojson/FdrXmlToJson.java b/src/main/java/it/gov/pagopa/fdrxmltojson/FdrXmlToJson.java index 78ee0f5..f57314b 100644 --- a/src/main/java/it/gov/pagopa/fdrxmltojson/FdrXmlToJson.java +++ b/src/main/java/it/gov/pagopa/fdrxmltojson/FdrXmlToJson.java @@ -203,10 +203,10 @@ public interface SupplierWithApiException { } private static String getHttpErrorMessage(ErrorEnum errorEnum, String fileName, HttpEventTypeEnum httpEventTypeEnum, String errorCode, Instant now){ - return "[ALERT] [error="+errorEnum.name()+"] [fileName"+fileName+"] [httpEventTypeEnum"+httpEventTypeEnum.name()+"] [errorCode="+errorCode+"] Http error at "+ now; + return "[ALERT] [error="+errorEnum.name()+"] [fileName="+fileName+"] [httpEventTypeEnum="+httpEventTypeEnum.name()+"] [errorCode="+errorCode+"] Http error at "+ now; } private static String getErrorMessage(ErrorEnum errorEnum, String fileName, Instant now){ - return "[ALERT] [error="+errorEnum.name()+"] [fileName"+fileName+"] Http error at "+ now; + return "[ALERT] [error="+errorEnum.name()+"] [fileName="+fileName+"] Http error at "+ now; } private static void manageHttpError(Logger logger, HttpEventTypeEnum httpEventTypeEnum, String fileName, String fdr, String pspId, SupplierWithApiException fn){ try { @@ -232,7 +232,7 @@ private static void sendGenericError(Logger logger, Instant now, String fileName _sendToErrorTable(logger, now, fileName, fdr, pspId, errorEnum, Optional.empty(),Optional.empty(), Optional.empty(), e); } private static void sendHttpError(Logger logger, Instant now, String fileName, String fdr, String pspId, ErrorEnum errorEnum, HttpEventTypeEnum httpEventTypeEnum, String httpErrorResposne, String httpErrorCode, Exception e){ - _sendToErrorTable(logger, now, fileName, fdr, pspId, errorEnum, Optional.of(httpEventTypeEnum), Optional.of(httpErrorResposne), Optional.of(httpErrorCode), e); + _sendToErrorTable(logger, now, fileName, fdr, pspId, errorEnum, Optional.ofNullable(httpEventTypeEnum), Optional.ofNullable(httpErrorResposne), Optional.of(httpErrorCode), e); } private static void _sendToErrorTable(Logger logger, Instant now, String fileName, String fdr, String pspId, ErrorEnum errorEnum, Optional httpEventTypeEnum, Optional httpErrorResposne, Optional httpErrorCode, Exception e){ String id = UUID.randomUUID().toString();