Convert CallError received on channel into exception.

pull/35/head
David Wilson 8 years ago
parent e7c4736b78
commit 2225ee2923

@ -126,9 +126,12 @@ class Channel(object):
return
IOLOG.debug('%r.on_receive() got %r', self, data)
if data == _DEAD:
if not isinstance(data, (Dead, CallError)):
return data
elif data == _DEAD:
raise ChannelError('Channel is closed.')
return data
else:
raise data
def __iter__(self):
"""Yield objects from this channel until it is closed."""

Loading…
Cancel
Save