exception = $exception; } /** * {@inheritdoc} */ public function when(callable $onResolved) { try { $onResolved($this->exception, null); } catch (\Throwable $exception) { Loop::defer(static function ($watcher, $exception) { throw $exception; }, $exception); } catch (\Exception $exception) { Loop::defer(static function ($watcher, $exception) { throw $exception; }, $exception); } } }