[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/http/src/Exception/ -> UnexpectedResponseException.php (source)

   1  <?php
   2  /**
   3   * Part of the Joomla Framework Http Package
   4   *
   5   * @copyright  Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE
   7   */
   8  
   9  namespace Joomla\Http\Exception;
  10  
  11  use Joomla\Http\Response;
  12  use Psr\Http\Client\ClientExceptionInterface;
  13  
  14  /**
  15   * Exception representing an unexpected response
  16   *
  17   * @since  1.2.0
  18   */
  19  class UnexpectedResponseException extends \DomainException implements ClientExceptionInterface
  20  {
  21      /**
  22       * The Response object.
  23       *
  24       * @var    Response
  25       * @since  1.2.0
  26       */
  27      private $response;
  28  
  29      /**
  30       * Constructor
  31       *
  32       * @param   Response    $response  The Response object.
  33       * @param   string      $message   The Exception message to throw.
  34       * @param   integer     $code      The Exception code.
  35       * @param   \Exception  $previous  The previous exception used for the exception chaining.
  36       *
  37       * @since   1.2.0
  38       */
  39  	public function __construct(Response $response, $message = '', $code = 0, \Exception $previous = null)
  40      {
  41          parent::__construct($message, $code, $previous);
  42  
  43          $this->response = $response;
  44      }
  45  
  46      /**
  47       * Get the Response object.
  48       *
  49       * @return  Response
  50       *
  51       * @since   1.2.0
  52       */
  53  	public function getResponse()
  54      {
  55          return $this->response;
  56      }
  57  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer