SUPPORT-8725: refactor trowing raw exception
This commit is contained in:
parent
7163c1ae5a
commit
0744ca6331
1 changed files with 2 additions and 2 deletions
|
|
@ -83,7 +83,7 @@ public class FileUploadService {
|
|||
Files.createDirectories(Paths.get(fileSavingPath));
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new RuntimeException("Failed to create directory " + fileSavingPath, e);
|
||||
throw new FileUploadException("Failed to create directory " + fileSavingPath, e);
|
||||
}
|
||||
LOGGER.info("working in {}", System.getProperty("user.home"));
|
||||
Path filePath = Paths.get(fileSavingPath, fileUrl.fileName());
|
||||
|
|
@ -131,7 +131,7 @@ public class FileUploadService {
|
|||
Files.delete(filePath);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new RuntimeException("Failed to delete file " + filePath.getFileName());
|
||||
throw new FileUploadException("Failed to delete file " + filePath.getFileName());
|
||||
}
|
||||
finally {
|
||||
acknowledgment.acknowledge();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue