[MERGE] An SMTPConnection class for bzrlib

Adeodato Simó dato at net.com.org.es
Wed Jun 20 01:30:43 BST 2007


* Aaron Bentley [Tue, 19 Jun 2007 20:19:46 -0400]:

> Adeodato Simó wrote:
> >> I think it would make sense to just let the smtplib errors pass
> >> through.

> > I agree with John here, and don't think it's nice for the user to get a
> > traceback if some step in the SMTP dialog fails.

> Responsibility for preventing a traceback should be taken at a higher
> level, not here.

Well, the problem is that, as I see it, the upper level can't really
prevent the error from happening, because it can't know in advance what
the SMTP server will react with an error code to. With this, I can't see
how this is an internal error.

If it's an internal error, every call to send_email() has to catch
SMTPError, and wrap it into a BzrCommandError or whatever appropriate;
if it's not, only those uses needing to handle it differently have to
catch it. (Though this is not the main point; the main point is that it
is not an internal error.)

Is my point clear (even if you don't agree)?

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
«¡Pero si es tan español que debe de tener el cerebro en forma de botijo,
con pitorro y todo!»
                -- Javier Cercas, “La velocidad de la luz”




More information about the bazaar mailing list