Skip to content

Commit 9b72a26

Browse files
authored
Avoid overriding the exception message with the raw message (#1516)
1 parent 66f95e1 commit 9b72a26

8 files changed

+0
-66
lines changed

src/Exception/InternalFailureException.php

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

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

87
/**
98
* An unexpected error has occurred.
109
*/
1110
final class InternalFailureException extends ServerException
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/InvalidRequestException.php

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

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

87
/**
98
* The request is not valid.
109
*/
1110
final class InvalidRequestException 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/ResourceAlreadyExistsException.php

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

41-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
42-
$this->message = $v;
43-
}
4441
$this->resourceId = isset($data['resourceId']) ? (string) $data['resourceId'] : null;
4542
$this->resourceArn = isset($data['resourceArn']) ? (string) $data['resourceArn'] : null;
4643
}

src/Exception/ResourceNotFoundException.php

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

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

87
/**
98
* The specified resource does not exist.
109
*/
1110
final class ResourceNotFoundException 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/ServiceUnavailableException.php

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

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

87
/**
98
* The service is temporarily unavailable.
109
*/
1110
final class ServiceUnavailableException extends ServerException
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/ThrottlingException.php

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

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

87
/**
98
* The rate exceeds the limit.
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/UnauthorizedException.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,10 @@
33
namespace AsyncAws\Iot\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 operation.
109
*/
1110
final class UnauthorizedException 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/VersionConflictException.php

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

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

87
/**
98
* An exception thrown when the version of an entity specified with the `expectedVersion` parameter does not match the
109
* latest version in the system.
1110
*/
1211
final class VersionConflictException 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)