/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/message.py

  • Committer: Andrew Bennetts
  • Date: 2009-01-09 06:22:45 UTC
  • mto: (3842.3.16 RemoteVersionedFile)
  • mto: This revision was merged to the branch mainline in revision 3981.
  • Revision ID: andrew.bennetts@canonical.com-20090109062245-jw5jbc723zefd8ru
Raise a better exception if a premature message end happens.

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
 
139
139
    def end_received(self):
140
140
        if self.expecting not in ['body', 'end']:
141
 
            raise AssertionError(
142
 
                'Message handler state %s not in [body, end]'
 
141
            raise errors.SmartProtocolError(
 
142
                'End of message received prematurely (while expecting %s)'
143
143
                % (self.expecting,))
144
144
        self.expecting = 'nothing'
145
145
        self.request_handler.end_received()