Skip to content

Commit 85867a0

Browse files
committed
Wrap inside exception.
1 parent 6523210 commit 85867a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Tasks/PageIterator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Exception;
66
use Http\Promise\FulfilledPromise;
77
use Http\Promise\Promise;
8+
use Http\Promise\RejectedPromise;
89
use InvalidArgumentException;
910
use JsonException;
1011
use Microsoft\Graph\Core\Models\PageResult;
@@ -148,7 +149,7 @@ private function fetchNextPage(): ?Promise {
148149
$nextLink = $this->currentPage->getOdataNextLink();
149150

150151
if ($nextLink === null) {
151-
return new FulfilledPromise($graphResponse);
152+
return new RejectedPromise(new InvalidArgumentException('The response does not have a nextLink'));
152153
}
153154

154155
if (!filter_var($nextLink, FILTER_VALIDATE_URL)) {

0 commit comments

Comments
 (0)