/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: John Arbash Meinel
  • Date: 2006-09-29 21:13:35 UTC
  • mto: This revision was merged to the branch mainline in revision 2110.
  • Revision ID: john@arbash-meinel.com-20060929211335-9af4fcf54348644e
Create a SocketConnectionError to make creating nice errors easier

Show diffs side-by-side

added added

removed removed

Lines of Context:
838
838
    """Connection error: %(msg)s %(orig_error)s"""
839
839
 
840
840
 
 
841
class SocketConnectionError(ConnectionError):
 
842
    """%(msg)s %(host)s%(port)s%(orig_error)s"""
 
843
 
 
844
    def __init__(self, host, port=None, msg=None, orig_error=None):
 
845
        if msg is None:
 
846
            msg = 'Failed to connect to'
 
847
        if orig_error is None:
 
848
            orig_error = ''
 
849
        else:
 
850
            orig_error = '; ' + str(orig_error)
 
851
        ConnectionError.__init__(self, msg=msg, orig_error=orig_error)
 
852
        self.host = host
 
853
        if port is None:
 
854
            self.port = ''
 
855
        else:
 
856
            self.port = ':%s' % port
 
857
 
 
858
 
841
859
class ConnectionReset(TransportError):
842
860
    """Connection closed: %(msg)s %(orig_error)s"""
843
861