-
Notifications
You must be signed in to change notification settings - Fork 7
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
silent failure on missconfiguration #7
Comments
I don't think a warning helps too much either - how about just logging it using |
That relies on people setting up a log writer though, and even our installer doesn’t do that. I’m leaning towards raising a warning - it doesn’t need any extra configuration, you can’t miss it unless you develop in live mode, and it should be suppressed in live mode by default. |
Doesn't it write to syslog by default? |
Nope, it doesn’t log anything anywhere unless you set it up 😕. Either way, you’d be completely unaware that you’d done anything wrong unless you happened to check those logs |
Yep. Whether you trigger a warning or log the error it will be hidden on a prod server until someone checks. This isn't really a problem for this module to solve because it's an issue with how SS mailer works... It never throws any error about whether emails are sent or not. Perhaps storing the last exception and allowing devs to access it |
How about this? if (Director::isDev()) {
user_error($e->getMessage(), E_USER_ERROR);
} else {
SS_Log::log($e->getMessage(), SS_Log::ERR);
} So it’s guaranteed to show up in dev mode, and anyone who wants to log errors in test/production envs can do so |
Sure.. I don't know how much a dev error would be as I imagine emails probably won't actually be sent on dev?? Maybe I'd log on both and error on dev only... SS_Log::log($e->getMessage(), SS_Log::ERR);
if (Director::isDev()) {
user_error($e->getMessage(), E_USER_ERROR);
} Though I'm not really a big fan of such big differences in behaviour on dev vs non-dev |
How about |
Looks good, I’ve gone for that: 87f8e00. Tagged as 2.0.1 |
in the Mailer class line 130, all exceptions are catch and never re-thrown causing silent error.
Could be a good idea to re throw the exception instead of returning false in the catch block, it will be very useful for debugging purpose.
The text was updated successfully, but these errors were encountered: