Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Fix log #3

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/it/gov/pagopa/fdrxmltojson/FdrXmlToJson.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ public interface SupplierWithApiException<T> {
}

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<T> void manageHttpError(Logger logger, HttpEventTypeEnum httpEventTypeEnum, String fileName, String fdr, String pspId, SupplierWithApiException<T> fn){
try {
Expand All @@ -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> httpEventTypeEnum, Optional<String> httpErrorResposne, Optional<String> httpErrorCode, Exception e){
String id = UUID.randomUUID().toString();
Expand Down