Skip to content

Commit

Permalink
Exit early if a request is not OK (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkamran80 authored Dec 17, 2024
1 parent 79700d4 commit c68088e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tests/SimilarWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export default async function (entryDomain, env, file) {
const errorDetails = `HTTP error ${res.status}\nError message: ${await res.text()}`;
if (!file) throw new Error(`Unable to fetch website rank — ${errorDetails}`);
else logger.addWarning(file, `Unable to fetch website rank for additional domain ${domain}${errorDetails}`);

return 1;
}

const json = await res.json();
Expand Down

0 comments on commit c68088e

Please sign in to comment.