-
-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update tests two bucket #2877
base: main
Are you sure you want to change the base?
Update tests two bucket #2877
Conversation
I think with the error messages I think it is fine to leave them out of the exception. But, I think we should make our own exception instead of reusing |
@kahgoh, thank you for the suggestion—it does make a lot of sense to create a custom exception for this purpose. public class UnreachableGoalException extends RuntimeException {
public UnreachableGoalException() {
super();
}
public UnreachableGoalException(String message) {
super(message);
}
public UnreachableGoalException(String message, Throwable cause) {
super(message, cause);
}
} That said, when I think about this, we've used While your suggestion is undoubtedly a more "proper" and robust approach, it might feel a little inconsistent with the conventions used elsewhere. What are your thoughts on this? How do you think I should proceed? |
I think there is also precedence for making our own exceptions for our exercises, like BinarySearch and TreeBuilding. But yeah, the think the exception would look something like that. |
Sure, I'll get right on it as soon as possible, since I already have the body of the custom Exception ready. However, I'll implement it the way it's done in exercises like "Binary Search" and "Tree Building," instead of following the approach in "Calculator Conundrum," as that causes build failure issues for Windows users (as highlighted in the forum discussion). I was also considering implementing similar custom Exceptions in exercises like "Change," since an unassignable change value shouldn’t technically throw an |
Pull Request
This PR adds 3 new tests to the Two Bucket exercise to sync with the
problem-specifications
repository. Two of the newly added tests check for error handling, which was not tested before. I am also unsure about the error message—should I keep it as it is in theproblem-specifications
repo or modify it to be more informative?Let me know your thoughts on this.
Reviewer Resources:
Track Policies