search_api_meilisearch-1.0.x-dev/src/Client/Exceptions/NetworkException.php

src/Client/Exceptions/NetworkException.php
<?php

namespace Drupal\search_api_meilisearch\Client\Exceptions;

use Psr\Http\Client\NetworkExceptionInterface;
use Psr\Http\Message\RequestInterface;

/**
 * Thrown when an error is encountered in the client.
 */
class NetworkException extends ClientException implements NetworkExceptionInterface {

  /**
   * The request that caused the exception.
   *
   * @var \Psr\Http\Message\RequestInterface
   */
  private RequestInterface $request;

  /**
   * NetworkException constructor.
   */
  public function __construct(string $message = "", int $code = 0, ?\Throwable $previous = NULL, ?RequestInterface $request = NULL) {
    parent::__construct($message, $code, $previous);
    $this->request = $request;
  }

  /**
   * Returns the request that caused the exception.
   *
   * @return \Psr\Http\Message\RequestInterface
   *   The request that caused the exception.
   */
  public function getRequest(): RequestInterface {
    return $this->request;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc