public function generatorResponse(): array
    {
        if ($this->endEvent instanceof ReturnedEvent) {
            return [null, $this->endEvent->value()];
        }

        if ($this->endEvent instanceof ThrewEvent) {
            return [$this->endEvent->exception(), null];
        }

        throw new UndefinedResponseException(
            'The call has not yet responded via generator.'
        );
    }