Skip to content

Commit

Permalink
chore: Log better error message if CDP data collection fails (#983)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Feb 18, 2025
1 parent b98e6fd commit 9476fd1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/commands/context/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,19 @@ async function collectWebviewsDetails(webviewsMapping, opts = {}) {
let port;
let host;
try {
[host, port] = await allocateDevtoolsChannel.bind(this)(item.proc, webviewDevtoolsPort);
[host, port] = /** @type {[string, number]} */ (
await allocateDevtoolsChannel.bind(this)(item.proc, webviewDevtoolsPort)
);
if (enableWebviewDetailsCollection) {
item.info = await cdpInfo(host, port);
}
if (ensureWebviewsHavePages) {
item.pages = await cdpList(host, port);
}
} catch (e) {
this.log.debug(e);
this.log.info(
`CDP data for '${item.webview}' cannot be collected. Original error: ${e.message}`
);
} finally {
if (port) {
try {
Expand Down

0 comments on commit 9476fd1

Please # to comment.