Skip to content

Commit

Permalink
add try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Aug 7, 2024
1 parent 5366cc8 commit 68a2cf6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/commands/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,16 @@ const extensions = {
}
this.log.debug(`No active pages have been detected after ${util.pluralize('retry', halfRetries, true)}`);
this.log.debug(`Opening ${this.getCurrentUrl()} in Safari to continue with the lookup`);
await this.proxyCommand('/url', 'POST', {
url: this.getCurrentUrl(),
bundleId: SAFARI_BUNDLE_ID,
idleTimeoutMs: DEFAULT_URL_LOAD_TIMEOUT_MS,
});
this._didOpenInitialSafariUrlViaWda = true;
try {
await this.proxyCommand('/url', 'POST', {
url: this.getCurrentUrl(),
bundleId: SAFARI_BUNDLE_ID,
idleTimeoutMs: DEFAULT_URL_LOAD_TIMEOUT_MS,
});
this._didOpenInitialSafariUrlViaWda = true;
} catch (e) {
this.log.warn(e.message);
}
return await doListPages(halfRetries);
}
return await doListPages(maxRetriesCount);
Expand Down

0 comments on commit 68a2cf6

Please sign in to comment.