Skip to content

Commit 8fd40ca

Browse files
authored
Avoid overriding the exception message with the raw message (#1516)
1 parent c1b0ff8 commit 8fd40ca

File tree

7 files changed

+0
-57
lines changed

7 files changed

+0
-57
lines changed

src/Exception/AccessDeniedException.php

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

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

87
/**
98
* You are not authorized to perform this action.
109
*/
1110
final class AccessDeniedException 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/InternalServerException.php

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

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

87
/**
98
* Timestream was unable to fully process this request because of an internal server error.
109
*/
1110
final class InternalServerException 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/InvalidEndpointException.php

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

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

87
/**
98
* The requested endpoint was not valid.
109
*/
1110
final class InvalidEndpointException 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/RejectedRecordsException.php

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

48-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
49-
$this->message = $v;
50-
}
5148
$this->rejectedRecords = empty($data['RejectedRecords']) ? [] : $this->populateResultRejectedRecords($data['RejectedRecords']);
5249
}
5350

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\TimestreamWrite\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 resource. The resource might not be specified correctly, or its status
109
* 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
}

src/Exception/ThrottlingException.php

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

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

87
/**
98
* Too many requests were made by a user and they exceeded the service quotas. The request was throttled.
109
*/
1110
final class ThrottlingException 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/ValidationException.php

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

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

87
/**
98
* An invalid or malformed request.
109
*/
1110
final class ValidationException 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
}

0 commit comments

Comments
 (0)