SUPPORT-8725:fix
This commit is contained in:
parent
0744ca6331
commit
c3ccfc9587
1 changed files with 3 additions and 9 deletions
|
|
@ -78,13 +78,7 @@ public class FileUploadService {
|
|||
|
||||
try {
|
||||
FileUrl fileUrl = parseFileUrl(downloadRequest.fileInfo().getFileUrl());
|
||||
|
||||
try {
|
||||
Files.createDirectories(Paths.get(fileSavingPath));
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new FileUploadException("Failed to create directory " + fileSavingPath, e);
|
||||
}
|
||||
Files.createDirectories(Paths.get(fileSavingPath));
|
||||
LOGGER.info("working in {}", System.getProperty("user.home"));
|
||||
Path filePath = Paths.get(fileSavingPath, fileUrl.fileName());
|
||||
String downloadUrl = fileUrl.fileUrl();
|
||||
|
|
@ -131,7 +125,7 @@ public class FileUploadService {
|
|||
Files.delete(filePath);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new FileUploadException("Failed to delete file " + filePath.getFileName());
|
||||
LOGGER.error("Failed to delete file " + filePath.getFileName(),e);
|
||||
}
|
||||
finally {
|
||||
acknowledgment.acknowledge();
|
||||
|
|
@ -146,7 +140,7 @@ public class FileUploadService {
|
|||
sendMessage(inStatusTopic.name(), downloadRequest, messageId, inKafkaTemplate);
|
||||
acknowledgment.acknowledge();
|
||||
}
|
||||
catch (FileUploadException e) {
|
||||
catch (FileUploadException | IOException e) {
|
||||
// считаем, что нужно повторное считывание сообщения
|
||||
// ошибку логируем, сообщение оставляем непрочитанным
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue