exception
This commit is contained in:
1 parent
43b15faa41
commit
7583274fff
2 files changed
+11
No files matched your search
@@ -21,6 +21,8 @@ public class ImageDao implements Dao<Image> {
|
||||
public ImageDao() {
|
||||
try {
|
||||
final var folderPath = new ClassPathResource("images");
|
||||
if (folderPath.exists())
|
||||
throw new ImageResourceMissingException("folderPath is null");
|
||||
final var folder = folderPath.getFile();
|
||||
getAllImages(folder);
|
||||
} catch (final Exception e) {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package pdl.backend;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
public class ImageResourceMissingException extends FileNotFoundException {
|
||||
public ImageResourceMissingException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user