Skip to content

Commit f3aa629

Browse files
authored
Merge pull request #378 from cookieguru/patch-1
Throw AuthException when profile data fetch fails due to checkpoint
2 parents 4076393 + 74e68a1 commit f3aa629

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Instagram/Transport/JsonProfileDataFeedV2.php

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public function fetchData(string $username): \StdClass
2525
'x-ig-app-id' => 936619743392459,
2626
]);
2727
} catch (\Exception $e) {
28+
if (str_contains($e->getMessage(), '{"message":"checkpoint_required"')) {
29+
throw new InstagramAuthException("Checkpoint required", $e->getCode(), $e);
30+
}
2831
throw new InstagramFetchException('Error: ' . $e->getMessage());
2932
}
3033

0 commit comments

Comments
 (0)