resolve($value); }; /** * Fails the awaitable with the given exception. * * @param \Exception $reason */ $fail = function ($reason) { $this->fail($reason); }; try { $resolver($resolve, $fail); } catch (\Throwable $exception) { $this->fail($exception); } catch (\Exception $exception) { $this->fail($exception); } } }