Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c1746d8

Browse files
committed
[HttpClient][Psr18Client] Remove Psr18ExceptionTrait
1 parent bbf7ed1 commit c1746d8

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/Symfony/Component/HttpClient/Psr18Client.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function sendRequest(RequestInterface $request): ResponseInterface
105105
/**
106106
* @internal
107107
*/
108-
trait Psr18ExceptionTrait
108+
class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface
109109
{
110110
private $request;
111111

@@ -121,18 +121,21 @@ public function getRequest(): RequestInterface
121121
}
122122
}
123123

124-
/**
125-
* @internal
126-
*/
127-
class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface
128-
{
129-
use Psr18ExceptionTrait;
130-
}
131-
132124
/**
133125
* @internal
134126
*/
135127
class Psr18RequestException extends \InvalidArgumentException implements RequestExceptionInterface
136128
{
137-
use Psr18ExceptionTrait;
129+
private $request;
130+
131+
public function __construct(TransportExceptionInterface $e, RequestInterface $request)
132+
{
133+
parent::__construct($e->getMessage(), 0, $e);
134+
$this->request = $request;
135+
}
136+
137+
public function getRequest(): RequestInterface
138+
{
139+
return $this->request;
140+
}
138141
}

0 commit comments

Comments
 (0)