exception

This commit is contained in:
Theophyl Hoguet committed 2023-03-13 22:52:22 +01:00
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() { public ImageDao() {
try { try {
final var folderPath = new ClassPathResource("images"); final var folderPath = new ClassPathResource("images");
if (folderPath.exists())
throw new ImageResourceMissingException("folderPath is null");
final var folder = folderPath.getFile(); final var folder = folderPath.getFile();
getAllImages(folder); getAllImages(folder);
} catch (final Exception e) { } 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);
}
}