mirror of
https://github.com/danog/parallel.git
synced 2024-11-30 04:39:01 +01:00
Fix issue with error handler
Using yield within the try block caused the error handler to persist through the next loop iteration, catching any error.
This commit is contained in:
parent
c25608c893
commit
a71abaf61d
@ -114,11 +114,13 @@ class Channel implements ChannelInterface
|
||||
|
||||
// Attempt to unserialize the received data.
|
||||
try {
|
||||
yield unserialize($buffer);
|
||||
$data = unserialize($buffer);
|
||||
} catch (\Exception $exception) {
|
||||
throw new ChannelException('Exception thrown when unserializing data.', 0, $exception);
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
yield $data;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user