Rev 3025: Use the right execption. in file:///v/home/vila/src/bzr/bugs/164567/

Vincent Ladeuil v.ladeuil+lp at free.fr
Sun Nov 25 14:52:25 GMT 2007


At file:///v/home/vila/src/bzr/bugs/164567/

------------------------------------------------------------
revno: 3025
revision-id:v.ladeuil+lp at free.fr-20071125145224-z85kx65oyzbic4t3
parent: v.ladeuil+lp at free.fr-20071125144415-ngzyqkqiww3uuuaw
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 164567
timestamp: Sun 2007-11-25 15:52:24 +0100
message:
  Use the right execption.
  
  * bzrlib/transport/ftp.py:
  (FtpTransport._create_connection): Use SocketConnectionError since
  it takes port=None into account.
modified:
  bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
-------------- next part --------------
=== modified file 'bzrlib/transport/ftp.py'
--- a/bzrlib/transport/ftp.py	2007-11-25 14:42:29 +0000
+++ b/bzrlib/transport/ftp.py	2007-11-25 14:52:24 +0000
@@ -144,9 +144,9 @@
             connection.login(user=user, passwd=password)
             connection.set_pasv(not self.is_active)
         except socket.error, e:
-            raise errors.ConnectionError(
-                'failed to connect to %s:%d' % (self._host, self._port),
-                orig_error= e)
+            raise errors.SocketConnectionError(self._host, self._port,
+                                               msg='Unable to connect to',
+                                               orig_error= e)
         except ftplib.error_perm, e:
             raise errors.TransportError(msg="Error setting up connection:"
                                         " %s" % str(e), orig_error=e)



More information about the bazaar-commits mailing list