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

Too many exceptions are swallowed in the email models #103

Open
gravesm opened this issue Aug 13, 2018 · 0 comments
Open

Too many exceptions are swallowed in the email models #103

gravesm opened this issue Aug 13, 2018 · 0 comments

Comments

@gravesm
Copy link

gravesm commented Aug 13, 2018

To some extent, this is a question of style, but there are two primary reasons why this practice should generally be avoided:

  1. You lose important information about the exception.
  2. The codebase gets bloated with conditional statements checking for True/False return values. There's an added burden on the developer to remember to check return values.

To the last point, see issue #102.

The better solution is to just let the exceptions bubble up. This is especially true when the only action taken during a failure is to log the failure. The exception should only be caught if you need to take some special action as a result.

Some examples of methods that could use rewriting:

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