Skip to content

Commit 23021ac

Browse files
authored
Avoid overriding the exception message with the raw message (#1516)
1 parent e47ab22 commit 23021ac

4 files changed

+0
-39
lines changed

src/Exception/InvalidArgumentException.php

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

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

87
/**
98
* The specified input parameter has a value that is not valid.
109
*/
1110
final class InvalidArgumentException 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/InvalidKMSResourceException.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace AsyncAws\Firehose\Exception;
44

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

87
/**
98
* Kinesis Data Firehose throws this exception when an attempt to put records or to start or stop delivery stream
@@ -12,15 +11,4 @@
1211
*/
1312
final class InvalidKMSResourceException extends ClientException
1413
{
15-
protected function populateResult(ResponseInterface $response): void
16-
{
17-
$data = $response->toArray(false);
18-
19-
if (null !== $v = (isset($data['code']) ? (string) $data['code'] : null)) {
20-
$this->code = $v;
21-
}
22-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
23-
$this->message = $v;
24-
}
25-
}
2614
}

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\Firehose\Exception;
44

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

87
/**
98
* The specified resource could not be found.
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,7 +3,6 @@
33
namespace AsyncAws\Firehose\Exception;
44

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

87
/**
98
* The service is unavailable. Back off and retry the operation. If you continue to see the exception, throughput limits
@@ -14,12 +13,4 @@
1413
*/
1514
final class ServiceUnavailableException extends ClientException
1615
{
17-
protected function populateResult(ResponseInterface $response): void
18-
{
19-
$data = $response->toArray(false);
20-
21-
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) {
22-
$this->message = $v;
23-
}
24-
}
2516
}

0 commit comments

Comments
 (0)