{"record":{"id":"3b4b68309a544932","repo":"garrytan/gstack","slug":"browse-client-command-cmd-failed-with-status","errorCode":null,"errorMessage":"browse-client: command \"${cmd}\" failed with status ${resp.status}","messagePattern":"browse-client: command \"(.+?)\" failed with status (.+?)","errorType":"exception","errorClass":"BrowseClientError","httpStatus":null,"severity":"error","filePath":"browse/src/browse-client.ts","lineNumber":186,"sourceCode":"      if (err.name === 'TimeoutError' || err.name === 'AbortError') {\n        throw new BrowseClientError(`browse-client: command \"${cmd}\" timed out after ${this.timeoutMs}ms`);\n      }\n      if (err.code === 'ECONNREFUSED') {\n        throw new BrowseClientError(`browse-client: daemon not running on port ${this.port}`);\n      }\n      throw new BrowseClientError(`browse-client: ${err.message ?? err}`);\n    }\n\n    const text = await resp.text();\n    if (!resp.ok) {\n      let message = `browse-client: command \"${cmd}\" failed with status ${resp.status}`;\n      try {\n        const parsed = JSON.parse(text);\n        if (parsed.error) message += `: ${parsed.error}`;\n      } catch {\n        if (text) message += `: ${text.slice(0, 200)}`;\n      }\n      throw new BrowseClientError(message, resp.status, text);\n    }\n    return text;\n  }\n\n  // ─── Navigation ─────────────────────────────────────────────────\n\n  async goto(url: string): Promise<string> { return this.command('goto', [url]); }\n  async wait(arg: string): Promise<string> { return this.command('wait', [arg]); }\n\n  // ─── Reading ────────────────────────────────────────────────────\n\n  async text(selector?: string): Promise<string> {\n    return this.command('text', selector ? [selector] : []);\n  }\n  async html(selector?: string): Promise<string> {\n    return this.command('html', selector ? [selector] : []);\n  }\n  async links(): Promise<string> { return this.command('links'); }","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/browse-client.ts#L168-L204","documentation":"Error \"browse-client: command \"${cmd}\" failed with status ${resp.status}\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/browse-client.ts:186 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}