Skip to content

Commit

Permalink
🐛 fix(fetcher.js): ignore Error: Address unavailable #86
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskyfung committed Feb 5, 2024
1 parent bfa123c commit b994afd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ export function getInstagramData(query) {
response = UrlFetchApp.fetch(query, params)
} catch (err) {
console.warn(`HTTP headers: ${JSON.stringify(response?.getHeaders())}`);
const errorMessage = `${err.message} (code: 0xf1)`;
throw new Error(errorMessage);
const errorMessage = `${err.message}`;
if (errorMessage.indexOf("Address unavailable:") !== -1) {
console.error(errorMessage);
return;
}
throw new Error(errorMessage + '(code: 0xf1)');
}
console.log(`status code: ${response.getResponseCode()}`);

Expand Down

0 comments on commit b994afd

Please sign in to comment.