From fc71437b5be404e8179c26187e5d6eb18473c729 Mon Sep 17 00:00:00 2001 From: JasonRay168 Date: Fri, 22 Sep 2023 17:33:32 +0800 Subject: [PATCH] Edit error message when tasks.txt file is not found --- src/main/java/echobot/utilities/Storage.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/echobot/utilities/Storage.java b/src/main/java/echobot/utilities/Storage.java index 3a9e27f69e..f8a5ccdbb5 100644 --- a/src/main/java/echobot/utilities/Storage.java +++ b/src/main/java/echobot/utilities/Storage.java @@ -47,7 +47,7 @@ public void overwriteTasksData(ArrayList tasks) { oos.flush(); oos.close(); } catch (IOException e) { - AlertBox alert = new AlertBox("IOException", "File not found or corrupted (overwriteTasksData() method)"); + AlertBox alert = new AlertBox("File not found or corrupted", "Please try to restart the app"); alert.show(); } } @@ -65,10 +65,10 @@ public ArrayList loadTasksData() { tasks = (ArrayList) ois.readObject(); ois.close(); } catch (IOException e) { - AlertBox alert = new AlertBox("IOException", "File not found or corrupted (loadTasksData method)"); + AlertBox alert = new AlertBox("File not found or corrupted", "Please try to restart the app"); alert.show(); } catch (ClassNotFoundException e) { - AlertBox alert = new AlertBox("ClassNotFoundException", "Class is not found"); + AlertBox alert = new AlertBox("ClassNotFoundException", "Class is not found, please restart the app"); alert.show(); } return tasks;