Skip to content

Commit

Permalink
Remove cancellation argument
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Sep 3, 2024
1 parent 30a740c commit 7335962
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/PsrHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Amp\Http\Client\Psr7;

use Amp\Cancellation;
use Amp\CancelledException;
use Amp\Http\Client\HttpClient;
use Amp\Http\Client\HttpException;
use Amp\Http\Client\InvalidRequestException;
Expand All @@ -18,17 +16,17 @@ public function __construct(private readonly HttpClient $httpClient, private rea
{
}

public function sendRequest(PsrRequest $request, ?Cancellation $cancellation = null): PsrResponse
public function sendRequest(PsrRequest $request): PsrResponse
{
$internalRequest = $this->psrAdapter->fromPsrRequest($request);

try {
$response = $this->httpClient->request($internalRequest, $cancellation);
$response = $this->httpClient->request($internalRequest);
} catch (InvalidRequestException $exception) {
throw new PsrRequestException($exception->getMessage(), $request, $exception);
} catch (SocketException $exception) {
throw new PsrNetworkException($exception->getMessage(), $request, $exception);
} catch (HttpException|CancelledException $exception) {
} catch (HttpException $exception) {
throw new PsrHttpClientException($exception->getMessage(), $request, $exception);
}

Expand Down

0 comments on commit 7335962

Please sign in to comment.