PluginProbe
Depicter — Popup & Slider Builder / 1.3.3
Depicter — Popup & Slider Builder v1.3.3
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / modules / GuzzleHttp / Exception / BadResponseException.php

BadResponseException.php in Depicter — Popup & Slider Builder 1.3.3, at modules/GuzzleHttp/Exception/BadResponseException.php

40 lines 1008 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Depicter\GuzzleHttp\Exception;
4
5 use Depicter\Psr\Http\Message\RequestInterface;
6 use Depicter\Psr\Http\Message\ResponseInterface;
7
8 /**
9 * Exception when an HTTP error occurs (4xx or 5xx error)
10 */
11 class BadResponseException extends RequestException
12 {
13 public function __construct(
14 string $message,
15 RequestInterface $request,
16 ResponseInterface $response,
17 \Throwable $previous = null,
18 array $handlerContext = []
19 ) {
20 parent::__construct($message, $request, $response, $previous, $handlerContext);
21 }
22
23 /**
24 * Current exception and the ones that extend it will always have a response.
25 */
26 public function hasResponse(): bool
27 {
28 return true;
29 }
30
31 /**
32 * This function narrows the return type from the parent class and does not allow it to be nullable.
33 */
34 public function getResponse(): ResponseInterface
35 {
36 /** @var ResponseInterface */
37 return parent::getResponse();
38 }
39 }
40