def __next__(self):
try:<EOL><INDENT>next = next(self.outbox)<EOL><DEDENT>except StopIteration as excp:<EOL><INDENT>self.log.debug('<STR_LIT>' % self)<EOL>self.finished = True<EOL>raise excp<EOL><DEDENT>except (AttributeError, RuntimeError) as excp:<EOL><INDENT>self.log.error('<STR_LIT>' % self)<EOL>raise PiperError('<STR_LIT>' % self, excp)<EOL><DEDENT>except IndexError as excp:<EOL><INDENT>self.log.error('<STR_LIT>' % self)<EOL>raise PiperError('<STR_LIT>' % self, excp)<EOL><DEDENT>except TimeoutError as excp:<EOL><INDENT>self.log.error('<STR_LIT>' %(self, self.timeout))<EOL>next = PiperError(excp)<EOL><DEDENT>if isinstance(next, WorkerError):<EOL><INDENT>self.log.error('<STR_LIT>' %(self, type(next[<NUM_LIT:0>]), next[<NUM_LIT:0>], next[<NUM_LIT:1>], next[<NUM_LIT:2>]))<EOL>if self.debug:<EOL><INDENT>raise PiperError('<STR_LIT>' %(self, type(next[<NUM_LIT:0>]), next[<NUM_LIT:0>], next[<NUM_LIT:1>], next[<NUM_LIT:2>]))<EOL><DEDENT>next = PiperError(next)<EOL><DEDENT>elif isinstance(next, PiperError):<EOL><INDENT>if self.debug:<EOL><INDENT>raise next<EOL><DEDENT>self.log.debug('<STR_LIT>' % (self, next[<NUM_LIT:0>]))<EOL><DEDENT>return next<EOL>
Returns the next result. If no result is availble within the specified 
(during construction) "timeout" then a ``PiperError`` which wraps a  
``TimeoutError`` is **returned**.

If the result is a ``WorkerError`` it is also wrapped in a 
``PiperError`` and is returned or raised if "debug" mode was specified 
at initialization. If the result is a ``PiperError`` it is propagated.