Skip to content
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

Improve exception strategy #25

Open
barnabycolby opened this issue Aug 16, 2016 · 0 comments
Open

Improve exception strategy #25

barnabycolby opened this issue Aug 16, 2016 · 0 comments
Labels
Milestone

Comments

@barnabycolby
Copy link
Owner

Currently, almost all of the exceptions used are checked exceptions, meaning that if an exception is thrown, the caller is forced to handle it before the code will successfully compile. This regularly results in a large list of exceptions that callers must handle, some of which should never occur, unless as a result of programmer error. This leads to developer frustration and lazy exception handling, lowering the overall code quality. It would be far better to throw unchecked exceptions in these situations. Some thought should also be given as to whether the caller can actually do anything to recover from the exception. In some cases, recovery is impossible and therefore the code should throw a runtime exception. At the highest possible level in the code, a try catch clause should be added to handle these unchecked exceptions, and display friendly error message to the user.

@barnabycolby barnabycolby added this to the 0.1 milestone Aug 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant