Skip to content

[HttpClient][Psr18Client] Remove Psr18ExceptionTrait #35025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions src/Symfony/Component/HttpClient/Psr18Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function sendRequest(RequestInterface $request): ResponseInterface
/**
* @internal
*/
trait Psr18ExceptionTrait
class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface
{
private $request;

Expand All @@ -121,18 +121,21 @@ public function getRequest(): RequestInterface
}
}

/**
* @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;
}
}