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 74a5da1 commit 52407b6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
9 changes: 0 additions & 9 deletions src/Exception/InvalidParameterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@
namespace AsyncAws\Ecr\Exception;

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

/**
* The specified parameter is invalid. Review the available parameters for the API request.
*/
final class InvalidParameterException 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/ServerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@
namespace AsyncAws\Ecr\Exception;

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

/**
* These errors are usually caused by a server-side issue.
*/
final class ServerException 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 52407b6

Please sign in to comment.