addressbook-level4 icon indicating copy to clipboard operation
addressbook-level4 copied to clipboard

Exceptions: update error messages

Open Zhiyuan-Amos opened this issue 7 years ago • 0 comments

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.

Zhiyuan-Amos avatar Feb 15 '18 00:02 Zhiyuan-Amos