mpyw\Co\Internal\YieldableUtils::safePromise PHP Méthode

safePromise() public static méthode

Return Promise that absorbs rejects, excluding fatal Throwable.
public static safePromise ( React\Promise\PromiseInterface $promise ) : React\Promise\PromiseInterface
$promise React\Promise\PromiseInterface
Résultat React\Promise\PromiseInterface
    public static function safePromise(PromiseInterface $promise)
    {
        return $promise->then(null, function ($value) {
            if (TypeUtils::isFatalThrowable($value)) {
                throw $value;
            }
            return $value;
        });
    }