Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Exceptions: update error messages #831

Open
Zhiyuan-Amos opened this issue Feb 15, 2018 · 0 comments
Open

Exceptions: update error messages #831

Zhiyuan-Amos opened this issue Feb 15, 2018 · 0 comments

Comments

@Zhiyuan-Amos
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants