Skip to content

Commit 872f870

Browse files
authored
Make sure we are always throwing an exception from Core (#841)
* Make sure we are always throwing an exception from Core * Make sure we generate classes to throw correct exception * ./generate --all * Shorten name * Do cover integrations * Added changelog
1 parent 8645b9a commit 872f870

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Result/ListLayerVersionsResponse.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace AsyncAws\Lambda\Result;
44

5+
use AsyncAws\Core\Exception\InvalidArgument;
56
use AsyncAws\Core\Response;
67
use AsyncAws\Core\Result;
78
use AsyncAws\Lambda\Enum\Runtime;
@@ -33,10 +34,10 @@ public function getIterator(): \Traversable
3334
{
3435
$client = $this->awsClient;
3536
if (!$client instanceof LambdaClient) {
36-
throw new \InvalidArgumentException('missing client injected in paginated result');
37+
throw new InvalidArgument('missing client injected in paginated result');
3738
}
3839
if (!$this->input instanceof ListLayerVersionsRequest) {
39-
throw new \InvalidArgumentException('missing last request injected in paginated result');
40+
throw new InvalidArgument('missing last request injected in paginated result');
4041
}
4142
$input = clone $this->input;
4243
$page = $this;
@@ -76,10 +77,10 @@ public function getLayerVersions(bool $currentPageOnly = false): iterable
7677

7778
$client = $this->awsClient;
7879
if (!$client instanceof LambdaClient) {
79-
throw new \InvalidArgumentException('missing client injected in paginated result');
80+
throw new InvalidArgument('missing client injected in paginated result');
8081
}
8182
if (!$this->input instanceof ListLayerVersionsRequest) {
82-
throw new \InvalidArgumentException('missing last request injected in paginated result');
83+
throw new InvalidArgument('missing last request injected in paginated result');
8384
}
8485
$input = clone $this->input;
8586
$page = $this;

0 commit comments

Comments
 (0)