/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-31 22:28:29 UTC
  • mfrom: (2052.4.5 sftp-error-49172)
  • Revision ID: pqm@pqm.ubuntu.com-20061031222829-d691c81a8a20bdb0
(John Arbash Meinel) Fix bug #49172: nicer errors on sftp connection failure

Show diffs side-by-side

added added

removed removed

Lines of Context:
874
874
    """Connection error: %(msg)s %(orig_error)s"""
875
875
 
876
876
 
 
877
class SocketConnectionError(ConnectionError):
 
878
    """%(msg)s %(host)s%(port)s%(orig_error)s"""
 
879
 
 
880
    def __init__(self, host, port=None, msg=None, orig_error=None):
 
881
        if msg is None:
 
882
            msg = 'Failed to connect to'
 
883
        if orig_error is None:
 
884
            orig_error = ''
 
885
        else:
 
886
            orig_error = '; ' + str(orig_error)
 
887
        ConnectionError.__init__(self, msg=msg, orig_error=orig_error)
 
888
        self.host = host
 
889
        if port is None:
 
890
            self.port = ''
 
891
        else:
 
892
            self.port = ':%s' % port
 
893
 
 
894
 
877
895
class ConnectionReset(TransportError):
878
896
    """Connection closed: %(msg)s %(orig_error)s"""
879
897