From a0030713228b2fe46d615b2dc8db2dedb90d66a3 Mon Sep 17 00:00:00 2001 From: deiflaender Date: Tue, 20 Jun 2023 12:20:18 +0200 Subject: [PATCH] RED-6934: Fixed too long error message for cause field in db --- .../service/persistence/FileStatusPersistenceService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/persistence/FileStatusPersistenceService.java b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/persistence/FileStatusPersistenceService.java index 8df7c94fc..68b4aeb0a 100644 --- a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/persistence/FileStatusPersistenceService.java +++ b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/persistence/FileStatusPersistenceService.java @@ -166,14 +166,20 @@ public class FileStatusPersistenceService { @Transactional public void updateStatusErrorInfo(String fileId, FileErrorInfo fileErrorInfo) { + if (fileErrorInfo == null) { fileRepository.updateStatusErrorInfo(fileId, null, null, null, null); } else { - fileRepository.updateStatusErrorInfo(fileId, fileErrorInfo.getCause(), fileErrorInfo.getQueue(), fileErrorInfo.getService(), fileErrorInfo.getTimestamp()); + fileRepository.updateStatusErrorInfo(fileId, + fileErrorInfo.getCause().substring(0, Math.min(fileErrorInfo.getCause().length(), 255)), + fileErrorInfo.getQueue(), + fileErrorInfo.getService(), + fileErrorInfo.getTimestamp()); } } + @Transactional public void updateProcessingStatus(String fileId, ProcessingStatus processingStatus) { -- 2.47.2