BadResponseException.php 806 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace GuzzleHttp\Exception;
  3. use Psr\Http\Message\RequestInterface;
  4. use Psr\Http\Message\ResponseInterface;
  5. /**
  6. * Exception when an HTTP error occurs (4xx or 5xx error)
  7. */
  8. class BadResponseException extends RequestException
  9. {
  10. public function __construct(
  11. $message,
  12. RequestInterface $request,
  13. ResponseInterface $response = null,
  14. \Exception $previous = null,
  15. array $handlerContext = []
  16. ) {
  17. if (null === $response) {
  18. @trigger_error(
  19. 'Instantiating the ' . __CLASS__ . ' class without a Response is deprecated since version 6.3 and will be removed in 7.0.',
  20. E_USER_DEPRECATED
  21. );
  22. }
  23. parent::__construct($message, $request, $response, $previous, $handlerContext);
  24. }
  25. }