se-edu / addressbook-level3

:ab::three: Address Book sample application (Level 3)
https://se-education.org/addressbook-level3
MIT License
28 stars 426 forks source link

[#139] Rephrase 'file not found' logs shown during first run #164

Closed Eclipse-Dominator closed 1 year ago

Eclipse-Dominator commented 1 year ago

Fixes #139 Continued from #152

Modified warning messages to show filepath

canihasreview[bot] commented 1 year ago

Click here to submit a new iteration when this PR is ready for review.

See this repository's contribution guide for more information.

Eclipse-Dominator commented 1 year ago

While working on this, I realised that the

            initialData = new AddressBook();
        } catch (IOException e) {
            logger.warning("Problem while reading from the file " + storage.getAddressBookFilePath()
                    + ". Will be starting with an empty AddressBook");
            initialData = new AddressBook();
        }

and

            initializedPrefs = new UserPrefs();
        } catch (IOException e) {
            logger.warning("Problem while reading from the file " + prefsFilePath
                    + ". Will be starting with an empty AddressBook");
            initializedPrefs = new UserPrefs();
        }

is unnecessary as the actual implementation of the methods used in the try block already handles the IO Exception, I will link a separate issue here #167

Eclipse-Dominator commented 1 year ago

use #170