mirror of
https://github.com/danog/parallel.git
synced 2024-12-03 10:07:49 +01:00
Attach oringal exception message to SerializationException
Related to #103.
This commit is contained in:
parent
346d3f5093
commit
15ead6c976
@ -21,7 +21,7 @@ final class ChannelParser extends Parser
|
|||||||
*
|
*
|
||||||
* @return string Encoded data that can be parsed by this class.
|
* @return string Encoded data that can be parsed by this class.
|
||||||
*
|
*
|
||||||
* @throws \Amp\Parallel\Sync\SerializationException
|
* @throws SerializationException
|
||||||
*/
|
*/
|
||||||
public function encode($data): string
|
public function encode($data): string
|
||||||
{
|
{
|
||||||
@ -29,7 +29,7 @@ final class ChannelParser extends Parser
|
|||||||
$data = \serialize($data);
|
$data = \serialize($data);
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
throw new SerializationException(
|
throw new SerializationException(
|
||||||
"The given data cannot be sent because it is not serializable.",
|
\sprintf("The given data cannot be sent because it is not serializable: %s", $exception->getMessage()),
|
||||||
0,
|
0,
|
||||||
$exception
|
$exception
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user