From c1746d8b1448356867fbaadeb1b7c60571545a8f Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Wed, 18 Dec 2019 16:09:02 +0100 Subject: [PATCH] [HttpClient][Psr18Client] Remove Psr18ExceptionTrait --- .../Component/HttpClient/Psr18Client.php | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Component/HttpClient/Psr18Client.php b/src/Symfony/Component/HttpClient/Psr18Client.php index 9ec7a08490..a251d42836 100644 --- a/src/Symfony/Component/HttpClient/Psr18Client.php +++ b/src/Symfony/Component/HttpClient/Psr18Client.php @@ -105,7 +105,7 @@ final class Psr18Client implements ClientInterface /** * @internal */ -trait Psr18ExceptionTrait +class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface { private $request; @@ -121,18 +121,21 @@ trait Psr18ExceptionTrait } } -/** - * @internal - */ -class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface -{ - use Psr18ExceptionTrait; -} - /** * @internal */ class Psr18RequestException extends \InvalidArgumentException implements RequestExceptionInterface { - use Psr18ExceptionTrait; + private $request; + + public function __construct(TransportExceptionInterface $e, RequestInterface $request) + { + parent::__construct($e->getMessage(), 0, $e); + $this->request = $request; + } + + public function getRequest(): RequestInterface + { + return $this->request; + } }