ExceptionInterface.php
2 years ago
IncompleteDsnException.php
1 month ago
InvalidArgumentException.php
2 years ago
InvalidResourceException.php
2 years ago
LogicException.php
2 years ago
MissingRequiredOptionException.php
1 month ago
NotFoundResourceException.php
2 years ago
ProviderException.php
1 month ago
ProviderExceptionInterface.php
2 years ago
RuntimeException.php
2 years ago
UnsupportedSchemeException.php
1 month ago
ProviderException.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace IAWPSCOPED\Symfony\Component\Translation\Exception; |
| 12 | |
| 13 | use IAWPSCOPED\Symfony\Contracts\HttpClient\ResponseInterface; |
| 14 | /** |
| 15 | * @author Fabien Potencier <fabien@symfony.com> |
| 16 | * @internal |
| 17 | */ |
| 18 | class ProviderException extends RuntimeException implements ProviderExceptionInterface |
| 19 | { |
| 20 | private $response; |
| 21 | private string $debug; |
| 22 | public function __construct(string $message, ResponseInterface $response, int $code = 0, \Exception $previous = null) |
| 23 | { |
| 24 | $this->response = $response; |
| 25 | $this->debug = $response->getInfo('debug') ?? ''; |
| 26 | parent::__construct($message, $code, $previous); |
| 27 | } |
| 28 | public function getResponse() : ResponseInterface |
| 29 | { |
| 30 | return $this->response; |
| 31 | } |
| 32 | public function getDebug() : string |
| 33 | { |
| 34 | return $this->debug; |
| 35 | } |
| 36 | } |
| 37 |