-
Notifications
You must be signed in to change notification settings - Fork 0
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 Error Handling #8
Conversation
This should return the error instead of calling And then handle the error in the same way here: https://github.com/kkoutsilis/SSMG/pull/8/files#diff-ab967ab1a2f3a1b769106eeb7bfe892ef0e81d1d27811fa15be08e6749feee1fL152 |
Have a look now :) @manavo |
Looking better! The only other consideration is that if one of the emails fails, the process exits rather than continuing. Might be worth saving how many fail. If they all succeed, there's no error to return. If at least one succeeds, return an error which shows how many (and which ones?) failed? |
Yeah, this needs to be improved |
@manavo Added a temp solution that does not stop the execution if there is an error sending some email, will work on a better solution later on. |
In this PR we improve the error handling mechanism by using RunE that returns an error instead of Run , and delegating the error handling to the caller instead of
log.Fatal()
every time there is an error in the code.