Skip to content

Commit

Permalink
Avoid overriding the exception message with the raw message (#1516)
Browse files Browse the repository at this point in the history
  • Loading branch information
stof authored Jul 8, 2023
1 parent 25a1c81 commit c9fb981
Show file tree
Hide file tree
Showing 27 changed files with 0 additions and 297 deletions.
11 changes: 0 additions & 11 deletions src/Exception/AuthorizationErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* Indicates that the user has been denied access to the requested resource.
*/
final class AuthorizationErrorException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/BatchEntryIdsNotDistinctException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* Two or more batch entries in the request have the same `Id`.
*/
final class BatchEntryIdsNotDistinctException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/BatchRequestTooLongException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The length of all the batch messages put together is more than the limit.
*/
final class BatchRequestTooLongException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/ConcurrentAccessException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* Can't perform multiple operations on a tag simultaneously. Perform the operations sequentially.
*/
final class ConcurrentAccessException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/EmptyBatchRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The batch request doesn't contain any entries.
*/
final class EmptyBatchRequestException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/EndpointDisabledException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* Exception error indicating endpoint disabled.
*/
final class EndpointDisabledException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/FilterPolicyLimitExceededException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,11 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* Indicates that the number of filter polices in your Amazon Web Services account exceeds the limit. To add more filter
* polices, submit an Amazon SNS Limit Increase case in the Amazon Web Services Support Center.
*/
final class FilterPolicyLimitExceededException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/InternalErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ServerException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* Indicates an internal service error.
*/
final class InternalErrorException extends ServerException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/InvalidBatchEntryIdException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The `Id` of a batch entry in a batch request doesn't abide by the specification.
*/
final class InvalidBatchEntryIdException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/InvalidParameterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* Indicates that a request parameter does not comply with the associated constraints.
*/
final class InvalidParameterException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/InvalidParameterValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* Indicates that a request parameter does not comply with the associated constraints.
*/
final class InvalidParameterValueException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/InvalidSecurityException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The credential signature isn't valid. You must use an HTTPS endpoint and sign your request using Signature Version 4.
*/
final class InvalidSecurityException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/KMSAccessDeniedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The ciphertext references a key that doesn't exist or that you don't have access to.
*/
final class KMSAccessDeniedException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/KMSDisabledException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The request was rejected because the specified customer master key (CMK) isn't enabled.
*/
final class KMSDisabledException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/KMSInvalidStateException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The request was rejected because the state of the specified resource isn't valid for this request. For more
Expand All @@ -14,14 +13,4 @@
*/
final class KMSInvalidStateException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/KMSNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The request was rejected because the specified entity or resource can't be found.
*/
final class KMSNotFoundException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/KMSOptInRequiredException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The Amazon Web Services access key ID needs a subscription for the service.
*/
final class KMSOptInRequiredException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
11 changes: 0 additions & 11 deletions src/Exception/KMSThrottlingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace AsyncAws\Sns\Exception;

use AsyncAws\Core\Exception\Http\ClientException;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* The request was denied due to request throttling. For more information about throttling, see Limits [^1] in the *Key
Expand All @@ -13,14 +12,4 @@
*/
final class KMSThrottlingException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = new \SimpleXMLElement($response->getContent(false));
if (0 < $data->Error->count()) {
$data = $data->Error;
}
if (null !== $v = (($v = $data->message) ? (string) $v : null)) {
$this->message = $v;
}
}
}
Loading

0 comments on commit c9fb981

Please sign in to comment.