File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
src/main/java/com/sprint/mission/discodeit/util Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,24 @@ public class DataInitializer {
18
18
19
19
public static void clearSerializedData () {
20
20
for (String path : FILE_PATHS ) {
21
- File file = Path .of (path ).toFile ();
22
- if (file .exists ()) {
23
- boolean deleted = file .delete ();
24
- if (deleted ) {
25
- System .out .println ("초기화 완료 " + file .getName ());
21
+ try {
22
+ File file = Path .of (path ).toFile ();
23
+
24
+ if (file .exists ()) {
25
+ boolean deleted = file .delete ();
26
+ if (deleted ) {
27
+ System .out .println ("초기화 완료 " + file .getName ());
28
+ } else {
29
+ System .out .println ("초기화 실패 " + file .getName ());
30
+ }
26
31
} else {
27
- System .out .println ("초기화 실패 " + file .getName ());
32
+ System .out .println ("초기화할 파일이 존재하지 않음 " + file .getName ());
28
33
}
34
+ } catch (Exception e ) {
35
+ System .out .println ("!예외 발생!" );
36
+ System .out .println (" 예외 타입: " + e .getClass ().getSimpleName ());
37
+ System .out .println (" 메시지: " + e .getMessage ());
38
+ e .printStackTrace ();
29
39
}
30
40
}
31
41
}
You can’t perform that action at this time.
0 commit comments