{"record":{"id":"18ac55a0ae50bdd5","repo":"jackwener/OpenCLI","slug":"subscribed-failed-result-detail","errorCode":null,"errorMessage":"subscribed failed: ${result.detail}","messagePattern":"subscribed failed: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/reddit/subscribed.js","lineNumber":154,"sourceCode":"      } catch (e) {\n        return { kind: 'exception', detail: String(e && e.message || e) };\n      }\n    })()`));\n        if (result?.kind === 'login-wall') {\n            // Convert the browser-side sentinel into a typed LoginWallError on the Node side.\n            throwIfLoginWall(result.sentinel, { url: result.where });\n        }\n        if (result?.kind === 'auth') {\n            throw new AuthRequiredError('reddit.com', result.detail);\n        }\n        if (result?.kind === 'http') {\n            throw new CommandExecutionError(`HTTP ${result.httpStatus} from ${result.where}`);\n        }\n        if (result?.kind === 'malformed') {\n            throw new CommandExecutionError(result.detail);\n        }\n        if (result?.kind === 'exception') {\n            throw new CommandExecutionError(`subscribed failed: ${result.detail}`);\n        }\n        if (result?.kind !== 'ok' || !Array.isArray(result.entries)) {\n            throw new CommandExecutionError(`Unexpected result from reddit subscribed: ${JSON.stringify(result)}`);\n        }\n        const rows = result.entries.slice(0, limit).map((entry, index) => mapSubredditRow(entry, index));\n        if (rows.length === 0) {\n            throw new EmptyResultError('Reddit returned no subscribed subreddits for the logged-in account.');\n        }\n        return rows;\n    }\n});\n","sourceCodeStart":136,"sourceCodeEnd":166,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/reddit/subscribed.js#L136-L166","documentation":"When the browser-side script throws, it returns {kind:'exception', detail}; subscribed.js rethrows it as CommandExecutionError(`subscribed failed: ${result.detail}`). This wraps any in-page JavaScript exception (failed fetch, DOM API missing, script error) that occurred while scraping the subscribed list. It is a catch-all converting page exceptions into a typed CLI error.","triggerScenarios":"page.evaluate script throws inside reddit.com: fetch rejection (network error), JSON.parse on unexpected body, DOM selectors absent because Reddit's markup changed.","commonSituations":"Browser offline or proxy failure during fetch; Reddit DOM/API changes breaking the injected scraper; extensions interfering with page scripts; navigation interrupted mid-evaluate.","solutions":["Read `detail` in the message to identify the underlying in-page exception.","Reload reddit.com in the attached browser and retry — transient fetch/network failures are the most common cause.","If detail indicates missing fields/selectors, update the CLI or its scraper to match current Reddit markup.","Verify network connectivity and that the browser tab stays on reddit.com for the duration of the command."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await run(['reddit', 'subscribed']);\n} catch (e) {\n  if (e.message.startsWith('subscribed failed:')) {\n    const detail = e.message.slice('subscribed failed:'.length);\n    log.error('in-page exception', detail); // then retry or report\n  } else throw e;\n}","preventionTips":["Keep the browser tab on reddit.com for the whole command duration","Keep CLI and scraper code updated against Reddit markup changes","Check network connectivity before batch runs","Disable interfering extensions in the automation profile"],"tags":["javascript","reddit","runtime-error"],"backgroundTag":"in-page-script-exception","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}