diff --git a/lib/Internal/ResolutionQueue.php b/lib/Internal/ResolutionQueue.php index ff5af70..0895977 100644 --- a/lib/Internal/ResolutionQueue.php +++ b/lib/Internal/ResolutionQueue.php @@ -67,12 +67,8 @@ final class ResolutionQueue try { $result = $callback($exception, $value); - if ($result instanceof \Awaitable) { - $result->onResolve(static function (?\Throwable $exception): void { - if ($exception) { - throw $exception; - } - }); + if ($result instanceof Promise) { + Promise\rethrow($result); } } catch (\Throwable $exception) { Loop::defer(static function () use ($exception): void {