Skip to content

Commit 7ef0b84

Browse files
authored
Avoid overriding the exception message with the raw message (#1516)
1 parent ffe25c1 commit 7ef0b84

7 files changed

+0
-77
lines changed

src/Exception/AccessDeniedException.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,10 @@
33
namespace AsyncAws\CloudFront\Exception;
44

55
use AsyncAws\Core\Exception\Http\ClientException;
6-
use Symfony\Contracts\HttpClient\ResponseInterface;
76

87
/**
98
* Access denied.
109
*/
1110
final class AccessDeniedException extends ClientException
1211
{
13-
protected function populateResult(ResponseInterface $response): void
14-
{
15-
$data = new \SimpleXMLElement($response->getContent(false));
16-
if (0 < $data->Error->count()) {
17-
$data = $data->Error;
18-
}
19-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
20-
$this->message = $v;
21-
}
22-
}
2312
}

src/Exception/BatchTooLargeException.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,10 @@
33
namespace AsyncAws\CloudFront\Exception;
44

55
use AsyncAws\Core\Exception\Http\ClientException;
6-
use Symfony\Contracts\HttpClient\ResponseInterface;
76

87
/**
98
* Invalidation batch specified is too large.
109
*/
1110
final class BatchTooLargeException extends ClientException
1211
{
13-
protected function populateResult(ResponseInterface $response): void
14-
{
15-
$data = new \SimpleXMLElement($response->getContent(false));
16-
if (0 < $data->Error->count()) {
17-
$data = $data->Error;
18-
}
19-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
20-
$this->message = $v;
21-
}
22-
}
2312
}

src/Exception/InconsistentQuantitiesException.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,10 @@
33
namespace AsyncAws\CloudFront\Exception;
44

55
use AsyncAws\Core\Exception\Http\ClientException;
6-
use Symfony\Contracts\HttpClient\ResponseInterface;
76

87
/**
98
* The value of `Quantity` and the size of `Items` don't match.
109
*/
1110
final class InconsistentQuantitiesException extends ClientException
1211
{
13-
protected function populateResult(ResponseInterface $response): void
14-
{
15-
$data = new \SimpleXMLElement($response->getContent(false));
16-
if (0 < $data->Error->count()) {
17-
$data = $data->Error;
18-
}
19-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
20-
$this->message = $v;
21-
}
22-
}
2312
}

src/Exception/InvalidArgumentException.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,10 @@
33
namespace AsyncAws\CloudFront\Exception;
44

55
use AsyncAws\Core\Exception\Http\ClientException;
6-
use Symfony\Contracts\HttpClient\ResponseInterface;
76

87
/**
98
* An argument is invalid.
109
*/
1110
final class InvalidArgumentException extends ClientException
1211
{
13-
protected function populateResult(ResponseInterface $response): void
14-
{
15-
$data = new \SimpleXMLElement($response->getContent(false));
16-
if (0 < $data->Error->count()) {
17-
$data = $data->Error;
18-
}
19-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
20-
$this->message = $v;
21-
}
22-
}
2312
}

src/Exception/MissingBodyException.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,10 @@
33
namespace AsyncAws\CloudFront\Exception;
44

55
use AsyncAws\Core\Exception\Http\ClientException;
6-
use Symfony\Contracts\HttpClient\ResponseInterface;
76

87
/**
98
* This operation requires a body. Ensure that the body is present and the `Content-Type` header is set.
109
*/
1110
final class MissingBodyException extends ClientException
1211
{
13-
protected function populateResult(ResponseInterface $response): void
14-
{
15-
$data = new \SimpleXMLElement($response->getContent(false));
16-
if (0 < $data->Error->count()) {
17-
$data = $data->Error;
18-
}
19-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
20-
$this->message = $v;
21-
}
22-
}
2312
}

src/Exception/NoSuchDistributionException.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,10 @@
33
namespace AsyncAws\CloudFront\Exception;
44

55
use AsyncAws\Core\Exception\Http\ClientException;
6-
use Symfony\Contracts\HttpClient\ResponseInterface;
76

87
/**
98
* The specified distribution does not exist.
109
*/
1110
final class NoSuchDistributionException extends ClientException
1211
{
13-
protected function populateResult(ResponseInterface $response): void
14-
{
15-
$data = new \SimpleXMLElement($response->getContent(false));
16-
if (0 < $data->Error->count()) {
17-
$data = $data->Error;
18-
}
19-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
20-
$this->message = $v;
21-
}
22-
}
2312
}

src/Exception/TooManyInvalidationsInProgressException.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,10 @@
33
namespace AsyncAws\CloudFront\Exception;
44

55
use AsyncAws\Core\Exception\Http\ClientException;
6-
use Symfony\Contracts\HttpClient\ResponseInterface;
76

87
/**
98
* You have exceeded the maximum number of allowable InProgress invalidation batch requests, or invalidation objects.
109
*/
1110
final class TooManyInvalidationsInProgressException extends ClientException
1211
{
13-
protected function populateResult(ResponseInterface $response): void
14-
{
15-
$data = new \SimpleXMLElement($response->getContent(false));
16-
if (0 < $data->Error->count()) {
17-
$data = $data->Error;
18-
}
19-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
20-
$this->message = $v;
21-
}
22-
}
2312
}

0 commit comments

Comments
 (0)