1
0
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:
Aaron Piotrowski 2015-10-28 18:50:01 -05:00
parent c25608c893
commit a71abaf61d

View File

@ -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;
}
}