1
0
mirror of https://github.com/danog/amp.git synced 2024-12-02 17:37:50 +01:00

Missed an Awaitable usage

This commit is contained in:
Aaron Piotrowski 2020-11-05 10:16:30 -06:00
parent 8d8358023f
commit cff6bba499
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -67,12 +67,8 @@ final class ResolutionQueue
try { try {
$result = $callback($exception, $value); $result = $callback($exception, $value);
if ($result instanceof \Awaitable) { if ($result instanceof Promise) {
$result->onResolve(static function (?\Throwable $exception): void { Promise\rethrow($result);
if ($exception) {
throw $exception;
}
});
} }
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
Loop::defer(static function () use ($exception): void { Loop::defer(static function () use ($exception): void {