phasync
AggregateException / getExceptions

Method

AggregateException::getExceptions

Returns the failures, all of them or those of one class.

Description#

public AggregateException::getExceptions(
    ?string $class = null
): array

Parameters#

$class ?string = null
Only the failures that are instances of it (subclasses and implementations included)

Return values#

In order: $fn's first, then the others as they happened array

Examples#

Example 1
foreach ($e->getExceptions(PDOException::class) as $failure) {
    $logger->critical($failure->getMessage());
}

See also#