Skip to content

Commit 7dfca95

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

10 files changed

+0
-110
lines changed

src/Exception/ConcurrentModificationException.php

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

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

87
/**
98
* The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few
109
* minutes and submit your request again.
1110
*/
1211
final class ConcurrentModificationException extends ClientException
1312
{
14-
protected function populateResult(ResponseInterface $response): void
15-
{
16-
$data = new \SimpleXMLElement($response->getContent(false));
17-
if (0 < $data->Error->count()) {
18-
$data = $data->Error;
19-
}
20-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
21-
$this->message = $v;
22-
}
23-
}
2413
}

src/Exception/DeleteConflictException.php

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

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

87
/**
98
* The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error
109
* message describes these entities.
1110
*/
1211
final class DeleteConflictException extends ClientException
1312
{
14-
protected function populateResult(ResponseInterface $response): void
15-
{
16-
$data = new \SimpleXMLElement($response->getContent(false));
17-
if (0 < $data->Error->count()) {
18-
$data = $data->Error;
19-
}
20-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
21-
$this->message = $v;
22-
}
23-
}
2413
}

src/Exception/EntityAlreadyExistsException.php

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

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

87
/**
98
* The request was rejected because it attempted to create a resource that already exists.
109
*/
1110
final class EntityAlreadyExistsException 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/EntityTemporarilyUnmodifiableException.php

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

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

87
/**
98
* The request was rejected because it referenced an entity that is temporarily unmodifiable, such as a user name that
@@ -12,14 +11,4 @@
1211
*/
1312
final class EntityTemporarilyUnmodifiableException extends ClientException
1413
{
15-
protected function populateResult(ResponseInterface $response): void
16-
{
17-
$data = new \SimpleXMLElement($response->getContent(false));
18-
if (0 < $data->Error->count()) {
19-
$data = $data->Error;
20-
}
21-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
22-
$this->message = $v;
23-
}
24-
}
2514
}

src/Exception/InvalidInputException.php

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

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

87
/**
98
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
109
*/
1110
final class InvalidInputException 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/LimitExceededException.php

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

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

87
/**
98
* The request was rejected because it attempted to create resources beyond the current Amazon Web Services account
109
* limits. The error message describes the limit exceeded.
1110
*/
1211
final class LimitExceededException extends ClientException
1312
{
14-
protected function populateResult(ResponseInterface $response): void
15-
{
16-
$data = new \SimpleXMLElement($response->getContent(false));
17-
if (0 < $data->Error->count()) {
18-
$data = $data->Error;
19-
}
20-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
21-
$this->message = $v;
22-
}
23-
}
2413
}

src/Exception/MalformedPolicyDocumentException.php

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

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

87
/**
98
* The request was rejected because the policy document was malformed. The error message describes the specific error.
109
*/
1110
final class MalformedPolicyDocumentException 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/NoSuchEntityException.php

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

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

87
/**
98
* The request was rejected because it referenced a resource entity that does not exist. The error message describes the
109
* resource.
1110
*/
1211
final class NoSuchEntityException extends ClientException
1312
{
14-
protected function populateResult(ResponseInterface $response): void
15-
{
16-
$data = new \SimpleXMLElement($response->getContent(false));
17-
if (0 < $data->Error->count()) {
18-
$data = $data->Error;
19-
}
20-
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
21-
$this->message = $v;
22-
}
23-
}
2413
}

src/Exception/ServiceFailureException.php

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

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

87
/**
98
* The request processing has failed because of an unknown error, exception or failure.
109
*/
1110
final class ServiceFailureException extends ServerException
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/ServiceNotSupportedException.php

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

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

87
/**
98
* The specified service does not support service-specific credentials.
109
*/
1110
final class ServiceNotSupportedException 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)