Skip to content

Commit 9e67ca8

Browse files
authored
Rename ParseResponse (#869)
* Rename ParseResponse * Rename to ParseResponseException * Updated changelog * Rename to UnparsableResponse * Cs fix
1 parent c223b5a commit 9e67ca8

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Support for Elastic Container Registry (ECR) in `AwsClientFactory`
99
- Read "region" from ini files.
1010
- Support for hard coded `roleArn` in `ConfigurationProvider`
11-
- Added exception `AsyncAws\Core\Exception\UnexpectedValue` and `AsyncAws\Core\Exception\ParseResponse`
11+
- Added exception `AsyncAws\Core\Exception\UnexpectedValue` and `AsyncAws\Core\Exception\UnparsableResponse`
1212

1313
### Fixed
1414

src/AwsError/AwsErrorFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace AsyncAws\Core\AwsError;
44

5-
use AsyncAws\Core\Exception\ParseResponse;
65
use AsyncAws\Core\Exception\RuntimeException;
76
use AsyncAws\Core\Exception\UnexpectedValue;
7+
use AsyncAws\Core\Exception\UnparsableResponse;
88
use Symfony\Contracts\HttpClient\ResponseInterface;
99

1010
/**
@@ -42,7 +42,7 @@ static function ($errno, $errstr, $errfile, $errline) {
4242

4343
return self::parseXml($xml);
4444
} catch (\Throwable $e) {
45-
throw new ParseResponse('Failed to parse AWS error: ' . $content, 0, $e);
45+
throw new UnparsableResponse('Failed to parse AWS error: ' . $content, 0, $e);
4646
}
4747
}
4848

src/Exception/Http/HttpExceptionTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use AsyncAws\Core\AwsError\AwsError;
66
use AsyncAws\Core\AwsError\AwsErrorFactory;
7-
use AsyncAws\Core\Exception\ParseResponse;
7+
use AsyncAws\Core\Exception\UnparsableResponse;
88
use Symfony\Contracts\HttpClient\ResponseInterface;
99

1010
/**
@@ -36,7 +36,7 @@ public function __construct(ResponseInterface $response)
3636

3737
try {
3838
$this->awsError = AwsErrorFactory::createFromResponse($response);
39-
} catch (ParseResponse $e) {
39+
} catch (UnparsableResponse $e) {
4040
// Ignore parsing error
4141
}
4242

src/Exception/ParseResponse.php renamed to src/Exception/UnparsableResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
namespace AsyncAws\Core\Exception;
66

7-
class ParseResponse extends \RuntimeException implements Exception
7+
class UnparsableResponse extends \RuntimeException implements Exception
88
{
99
}

src/HttpClient/AwsRetryStrategy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace AsyncAws\Core\HttpClient;
44

55
use AsyncAws\Core\AwsError\AwsErrorFactory;
6-
use AsyncAws\Core\Exception\ParseResponse;
6+
use AsyncAws\Core\Exception\UnparsableResponse;
77
use Symfony\Component\HttpClient\Response\AsyncContext;
88
use Symfony\Component\HttpClient\Retry\GenericRetryStrategy;
99
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
@@ -37,7 +37,7 @@ public function shouldRetry(AsyncContext $context, ?string $responseContent, ?Tr
3737

3838
try {
3939
$error = AwsErrorFactory::createFromContent($responseContent, $context->getHeaders());
40-
} catch (ParseResponse $e) {
40+
} catch (UnparsableResponse $e) {
4141
return false;
4242
}
4343

0 commit comments

Comments
 (0)