Skip to content

Commit

Permalink
Fix Exception Handling
Browse files Browse the repository at this point in the history
  • Loading branch information
l5_z committed Mar 7, 2024
1 parent ec166e5 commit bbbf5d9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion src/main/java/Handler.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/Jarvas.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import java.io.IOException;
import java.util.ArrayList;

/**
Expand All @@ -15,8 +14,6 @@ public static void main(String[] args) {
ArrayList<Task> tasks = Handler.initialiseBot();
try {
Handler.processInput(tasks);
} catch (IOException e) {
throw new CustomException(Constant.SAVE_ERROR + e.getMessage());
} catch (CustomException e) {
Reply.printException(e);
} finally {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Persistence.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void saveTasks(ArrayList<Task> tasks) throws CustomException {
writer.close();

} catch (IOException e) {
throw new CustomException(Constant.SAVE_ERROR);
throw new CustomException(Constant.SAVE_ERROR + e.getMessage());
}
}

Expand Down

0 comments on commit bbbf5d9

Please sign in to comment.