Optimized Exception handling for Deleting Accounts in PrivateBank.java

This commit is contained in:
2024-12-09 17:48:30 +01:00
parent db8ee0c3e6
commit 05ab636670

View File

@@ -379,7 +379,7 @@ public class PrivateBank implements Bank, JsonSerializer<Transaction>, JsonDeser
String filename = directoryName + "/" + account + ".json";
File file = new File(filename);
if (!file.delete())
throw new IOException();
throw new IOException("Datei des Accounts: " + account + " konnte nicht richtig gelöscht werden.");
} else {
throw new AccountDoesNotExistException();
}