Merge branch 'ExceptionBesoin1' into 'main'
Exception besoin1 See merge request pdl-l3/teams/2023/v1/v1d!11
This commit is contained in:
commit
3d076e21d3
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("folder images doesn't not exsit");
|
||||||
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user