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

Refactor internal error handling #149

Open
fxjordan opened this issue Apr 8, 2022 · 0 comments
Open

Refactor internal error handling #149

fxjordan opened this issue Apr 8, 2022 · 0 comments
Assignees

Comments

@fxjordan
Copy link
Contributor

fxjordan commented Apr 8, 2022

Often we have a try-catch block around method bodies that catches all exceptions, logs them at warning level, and simply continues execution flow. This results in a lot of null values to be returned, causing NullPointerExceptions somewhere else in the code (which is hard to debug).

Better throw unchecked exceptions and return only non-null values in success cases (e.g., when sending e-mail notifications, only the top level function should catch exceptions to avoid one recipient canceling the delivery of all other emails). However, when an exception occurs during e-mail content generation (e.g., generateAdditionalObject in NotificationDispatcherImpl) this is an unexpected exception and should be thrown to a higher level method (instead of returning null).

This is just one example of bad exception handling in Requirements Bazaar, so we should work through different parts of the code from time to time to refactor!

@fxjordan fxjordan self-assigned this Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant