Skip to content

Commit

Permalink
Merge pull request #378 from cookieguru/patch-1
Browse files Browse the repository at this point in the history
Throw AuthException when profile data fetch fails due to checkpoint
  • Loading branch information
pgrimaud committed Apr 19, 2024
2 parents 4076393 + 74e68a1 commit f3aa629
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Instagram/Transport/JsonProfileDataFeedV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function fetchData(string $username): \StdClass
'x-ig-app-id' => 936619743392459,
]);
} catch (\Exception $e) {
if (str_contains($e->getMessage(), '{"message":"checkpoint_required"')) {
throw new InstagramAuthException("Checkpoint required", $e->getCode(), $e);
}
throw new InstagramFetchException('Error: ' . $e->getMessage());
}

Expand Down

0 comments on commit f3aa629

Please sign in to comment.