code: public function reject(Exception $exception)
      {
          if (HttpPromise::PENDING !== $this->state) {
              throw new \RuntimeException('Promise is already resolved');
          }
  
          $this->state = HttpPromise::REJECTED;
          $this->exception = $exception;
          $this->doReject($exception);
      }
docs: Reject this promise.
  
  @param Exception $exception
  
  @internal