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 committed Jul 8, 2023
1 parent ba0ca5a commit 20278ab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
9 changes: 0 additions & 9 deletions src/Exception/InvalidRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@
namespace AsyncAws\XRay\Exception;

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

/**
* The request is missing required parameters or has invalid parameters.
*/
final class InvalidRequestException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = $response->toArray(false);

if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
$this->message = $v;
}
}
}
9 changes: 0 additions & 9 deletions src/Exception/ThrottledException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@
namespace AsyncAws\XRay\Exception;

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

/**
* The request exceeds the maximum number of requests per second.
*/
final class ThrottledException extends ClientException
{
protected function populateResult(ResponseInterface $response): void
{
$data = $response->toArray(false);

if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
$this->message = $v;
}
}
}

0 comments on commit 20278ab

Please sign in to comment.