Skip to content

Commit e06dd96

Browse files
authored
Avoid overriding the exception message with the raw message (#1516)
1 parent 782fe42 commit e06dd96

13 files changed

+0
-105
lines changed

src/Exception/ConditionalCheckFailedException.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ protected function populateResult(ResponseInterface $response): void
3030
{
3131
$data = $response->toArray(false);
3232

33-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
34-
$this->message = $v;
35-
}
3633
$this->item = empty($data['Item']) ? [] : $this->populateResultAttributeMap($data['Item']);
3734
}
3835

src/Exception/DuplicateItemException.php

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

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

87
/**
98
* There was an attempt to insert an item with the same primary key as an item that already exists in the DynamoDB
109
* table.
1110
*/
1211
final class DuplicateItemException extends ClientException
1312
{
14-
protected function populateResult(ResponseInterface $response): void
15-
{
16-
$data = $response->toArray(false);
17-
18-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
19-
$this->message = $v;
20-
}
21-
}
2213
}

src/Exception/IdempotentParameterMismatchException.php

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

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

87
/**
98
* DynamoDB rejected the request because you retried a request with a different payload but with an idempotent token
109
* that was already used.
1110
*/
1211
final class IdempotentParameterMismatchException extends ClientException
1312
{
14-
protected function populateResult(ResponseInterface $response): void
15-
{
16-
$data = $response->toArray(false);
17-
18-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
19-
$this->message = $v;
20-
}
21-
}
2213
}

src/Exception/InternalServerErrorException.php

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

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

87
/**
98
* An error occurred on the server side.
109
*/
1110
final class InternalServerErrorException extends ClientException
1211
{
13-
protected function populateResult(ResponseInterface $response): void
14-
{
15-
$data = $response->toArray(false);
16-
17-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
18-
$this->message = $v;
19-
}
20-
}
2112
}

src/Exception/ItemCollectionSizeLimitExceededException.php

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

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

87
/**
98
* An item collection is too large. This exception is only returned for tables that have one or more local secondary
109
* indexes.
1110
*/
1211
final class ItemCollectionSizeLimitExceededException extends ClientException
1312
{
14-
protected function populateResult(ResponseInterface $response): void
15-
{
16-
$data = $response->toArray(false);
17-
18-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
19-
$this->message = $v;
20-
}
21-
}
2213
}

src/Exception/LimitExceededException.php

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

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

87
/**
98
* There is no limit to the number of daily on-demand backups that can be taken.
@@ -27,12 +26,4 @@
2726
*/
2827
final class LimitExceededException extends ClientException
2928
{
30-
protected function populateResult(ResponseInterface $response): void
31-
{
32-
$data = $response->toArray(false);
33-
34-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
35-
$this->message = $v;
36-
}
37-
}
3829
}

src/Exception/ProvisionedThroughputExceededException.php

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

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

87
/**
98
* Your request rate is too high. The Amazon Web Services SDKs for DynamoDB automatically retry requests that receive
@@ -15,12 +14,4 @@
1514
*/
1615
final class ProvisionedThroughputExceededException extends ClientException
1716
{
18-
protected function populateResult(ResponseInterface $response): void
19-
{
20-
$data = $response->toArray(false);
21-
22-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
23-
$this->message = $v;
24-
}
25-
}
2617
}

src/Exception/RequestLimitExceededException.php

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

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

87
/**
98
* Throughput exceeds the current throughput quota for your account. Please contact Amazon Web Services Support [^1] to
@@ -13,12 +12,4 @@
1312
*/
1413
final class RequestLimitExceededException extends ClientException
1514
{
16-
protected function populateResult(ResponseInterface $response): void
17-
{
18-
$data = $response->toArray(false);
19-
20-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
21-
$this->message = $v;
22-
}
23-
}
2415
}

src/Exception/ResourceInUseException.php

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

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

87
/**
98
* The operation conflicts with the resource's availability. For example, you attempted to recreate an existing table,
109
* or tried to delete a table currently in the `CREATING` state.
1110
*/
1211
final class ResourceInUseException extends ClientException
1312
{
14-
protected function populateResult(ResponseInterface $response): void
15-
{
16-
$data = $response->toArray(false);
17-
18-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
19-
$this->message = $v;
20-
}
21-
}
2213
}

src/Exception/ResourceNotFoundException.php

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

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

87
/**
98
* The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its
109
* status might not be `ACTIVE`.
1110
*/
1211
final class ResourceNotFoundException extends ClientException
1312
{
14-
protected function populateResult(ResponseInterface $response): void
15-
{
16-
$data = $response->toArray(false);
17-
18-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
19-
$this->message = $v;
20-
}
21-
}
2213
}

0 commit comments

Comments
 (0)