Skip to content

Commit

Permalink
handle request network error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhelvis committed Aug 9, 2021
1 parent 6a289da commit e123448
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,19 @@ const safebrowsing = (function () {
suspendSafebrowsing();
}

if (response.status >= 500) {
if (response && response.status >= 500) {
// Error on server side, suspend request
// eslint-disable-next-line max-len
log.error('Error response status {0} received from safebrowsing lookup server.', response.status);
suspendSafebrowsing();
return;
}

if (!response) {
log.error('Error request sent to safebrowsing lookup server.');
return;
}

resumeSafebrowsing();

shortHashes.forEach((x) => {
Expand Down

0 comments on commit e123448

Please sign in to comment.