From 252d0177d8b9af5767c1f2f717bfea1b521d339d Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Tue, 25 Nov 2025 15:43:37 +0100 Subject: [PATCH] refactor: avoid throwing in resolveCdpElementId --- src/McpContext.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/McpContext.ts b/src/McpContext.ts index 7536fe78..1b0c586f 100644 --- a/src/McpContext.ts +++ b/src/McpContext.ts @@ -199,11 +199,10 @@ export class McpContext implements Context { this.logger('no cdpBackendNodeId'); return; } - if (this.#textSnapshot === null) - throw new Error( - "The snapshot is not defined, can't resolve backendNodeId: " + - cdpBackendNodeId, - ); + if (this.#textSnapshot === null) { + this.logger('no text snapshot'); + return; + } // TODO: index by backendNodeId instead. const queue = [this.#textSnapshot.root]; while (queue.length) {