chairemobilite / transition

Transition is a modern new approach to transit planning. It's a web application to model, simulate and plan public transit and alternative transportation.
http://transition.city
MIT License
20 stars 13 forks source link

userEmail: Add try/catch around email sending functions #928

Closed tahini closed 2 months ago

tahini commented 2 months ago

Sending email is often done asynchronously by the server and there is nothing to catch the error in the sendEmail promise. All email sending functions now catch and log the exception before throwing it back.

tahini commented 2 months ago

Wonder if we want more logging into the sendEmail function directly (if possible, it might be an external lib)

more logging as in "log more stuff"? like mail to, mail from, etc? Callers already log the fact that an email was sent, now it should log errors as well. We'll see if we get the information we might need for the unsent emails. Otherwise, we can look into more logging.

greenscientist commented 2 months ago

@tahini , no, in particular not the email address per se, that would be too personnnal. But it seem that we have to duplicate the logging in multiplace, so it instead we log when we generate error, that could e simpler. (The logging in the caller is also good to know where the probleme was. But we are far from having too much logging :) )