Skip to content

Commit

Permalink
handle error for ig story
Browse files Browse the repository at this point in the history
  • Loading branch information
thoriqazzikraa committed Sep 16, 2023
1 parent 4e91b04 commit 86017b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ async function igStory(username) {
}
result.media.push(url);
});
if (result.media.length === 0) {
result.status = false;
result.media = null;
result.message = `The account you're looking for doesn't have any stories or maybe the account is private.`;
}
return result;
} catch (err) {
console.log(err);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scrape-websitee",
"version": "1.0.37",
"version": "1.0.38",
"description": "Website Scraping",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 86017b1

Please sign in to comment.