-
-
Notifications
You must be signed in to change notification settings - Fork 185
Throwing exception in a child results in empty ParralelError in catch() #254
Copy link
Copy link
Closed
Description
I am confused
$pool->add(function () use ($selectedCompressor, $sourcePath, $targetPath) {
try {
return $selectedCompressor->compress($sourcePath, $targetPath);
} catch (\Throwable $throwable) {
throw new CompressionFailedException($sourcePath, previous: $throwable);
}
})->then(function (?CompressionResult $compressionResult) use ($stats, $updateUi, $sourcePath, $targetPath, $fileEntry) {
// not relevant
})->catch(function (CompressionFailedException $exception) use ($stats) {
// works
})
->catch(function (\Throwable $exception) use ($stats) {
// also throws, but its empty Spatie\Async\Output\ParallelError - no message, no code, weird trace, what is going on
\Symfony\Component\VarDumper\VarDumper::dump(['anything' => $exception]);
});
// the compressor compress function
public function compress(string $source, string $target): CompressionResult
{
throw new CompressionFailedException('test.zip');
}Either the exception type filtering doesn't work properly, or I am missing something.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels