/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/smart/medium.py

  • Committer: Martin Pool
  • Date: 2008-02-06 00:41:04 UTC
  • mfrom: (3215 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3219.
  • Revision ID: mbp@sourcefrog.net-20080206004104-mxtn32habuhjq6b8
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
358
358
            new_char = self.read_bytes(1)
359
359
            line += new_char
360
360
            if new_char == '':
361
 
                raise errors.SmartProtocolError(
362
 
                    'unexpected end of file reading from server')
 
361
                # end of file encountered reading from server
 
362
                raise errors.ConnectionReset(
 
363
                    "please check connectivity and permissions",
 
364
                    "(and try -Dhpss if further diagnosis is required)")
363
365
        return line
364
366
 
365
367
 
545
547
            port = BZR_DEFAULT_PORT
546
548
        else:
547
549
            port = int(self._port)
548
 
        result = self._socket.connect_ex((self._host, port))
549
 
        if result:
 
550
        try:
 
551
            self._socket.connect((self._host, port))
 
552
        except socket.error, err:
 
553
            # socket errors either have a (string) or (errno, string) as their
 
554
            # args.
 
555
            if type(err.args) is str:
 
556
                err_msg = err.args
 
557
            else:
 
558
                err_msg = err.args[1]
550
559
            raise errors.ConnectionError("failed to connect to %s:%d: %s" %
551
 
                    (self._host, port, os.strerror(result)))
 
560
                    (self._host, port, err_msg))
552
561
        self._connected = True
553
562
 
554
563
    def _flush(self):