Unverified Commit 5354c16d authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3188957 by anmolgoyal74, abarrio, xjm: Use...

Issue #3188957 by anmolgoyal74, abarrio, xjm: Use RequestException::hasResponse() in DrupalTestBrowser
parent 5cac1604
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -140,12 +140,10 @@ protected function doRequest($request) {
    // to re-throw the exception whenever the response is NULL, and
    // ConnectException always has a NULL response.
    catch (RequestException $e) {
      $response = $e->getResponse();
      // @todo RequestException has a hasResponse() method which we could use
      //   here instead. https://www.drupal.org/project/drupal/issues/3188957
      if (NULL === $response) {
      if (!$e->hasResponse()) {
        throw $e;
      }
      $response = $e->getResponse();
    }

    return $this->createResponse($response);