addressbook-level4
addressbook-level4 copied to clipboard
Exceptions: update error messages
PersonNotFoundException
can only be initialized using the empty constructor and does not have an error message. Also, DuplicatePersonException
can only be initialized with a default error message.
The lack of error message and undescriptive error messages in exceptions aren't helpful for debugging purposes.
I'm suggesting that we can pass in the Person
object as a parameter (and we call Person#toString()
as the value for the error message) when constructing these exceptions, so that we can know which Person
object caused the exception.