[HttpClient][Psr18Client] Remove Psr18ExceptionTrait

This commit is contained in:
Thomas Calvet 2019-12-18 16:09:02 +01:00
parent bbf7ed12b1
commit c1746d8b14

View File

@ -105,7 +105,7 @@ final class Psr18Client implements ClientInterface
/** /**
* @internal * @internal
*/ */
trait Psr18ExceptionTrait class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface
{ {
private $request; private $request;
@ -121,18 +121,21 @@ trait Psr18ExceptionTrait
} }
} }
/**
* @internal
*/
class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface
{
use Psr18ExceptionTrait;
}
/** /**
* @internal * @internal
*/ */
class Psr18RequestException extends \InvalidArgumentException implements RequestExceptionInterface 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;
}
} }