{"record":{"id":"f9c1339a94256d51","repo":"jackwener/OpenCLI","slug":"no-posts-found-in-this-band","errorCode":null,"errorMessage":"No posts found in this Band","messagePattern":"No posts found in this Band","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/band/posts.js","lineNumber":91,"sourceCode":"          // Post body text (strip Band markup tags, truncate for listing).\n          const bodyEl = el.querySelector('.postText._postText');\n          const content = bodyEl\n            ? stripTags(norm(bodyEl.innerText || bodyEl.textContent)).slice(0, 120)\n            : '';\n\n          // Comment count is in span.count inside the count area.\n          const commentEl = el.querySelector('span.count');\n          const comments = commentEl ? parseInt((commentEl.textContent || '').replace(/[^0-9]/g, ''), 10) || 0 : 0;\n\n          if (results.length >= limit) break;\n          results.push({ date, author, content, comments, url });\n        }\n\n        return results;\n      })()\n    `);\n        if (!posts || posts.length === 0) {\n            throw new EmptyResultError('band posts', 'No posts found in this Band');\n        }\n        return posts;\n    },\n});\n","sourceCodeStart":73,"sourceCodeEnd":96,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/band/posts.js#L73-L96","documentation":"The Band posts command threw an EmptyResultError because the scraper/browser evaluation returned no posts (null, empty array, or missing data) for the requested Band. The CLI throws this deliberately so an empty scrape is reported as a clean 'no results' condition instead of silently outputting nothing. It usually means the Band exists but has no visible posts, or the logged-in session could not see them.","triggerScenarios":"Running the `band posts` command when the in-browser evaluation script returns posts that are null or an array of length 0. Specifically: the Band URL resolves but contains no post elements in the DOM, or the extraction script's returned expression evaluates to no rows.","commonSituations":"Targeting a newly created or empty Band; scraping a private/closed Band whose posts are not visible to the current session cookie; Band pages that lazy-load posts and render none before the extraction script runs; a typo'd band name/URL landing on a valid but empty view; session expiry causing the extractor to find zero visible posts.","solutions":["Verify the Band actually has posts by opening it in a browser with the same logged-in account.","Re-authenticate / refresh session cookies so the scraper can see the Band's content, then retry.","Confirm the band identifier/URL passed to the command is correct and points at the intended Band.","If the Band genuinely has no posts, treat this as an expected empty result and skip or handle it in your script."],"exampleFix":"// before\nconst posts = await run('band posts --band myband'); // throws when empty\n// after\nlet posts;\ntry {\n  posts = await run('band posts --band myband');\n} catch (e) {\n  if (e.name === 'EmptyResultError') posts = [];\n  else throw e;\n}","handlingStrategy":"try-catch","validationCode":"// Pre-check the band has posts before calling\nconst bandPage = await fetch(bandUrl, { headers: { cookie: sessionCookie } });\nif (!bandPage.ok || !(await bandPage.text()).includes('post')) {\n  console.warn('Band appears empty or inaccessible; skipping posts fetch');\n}","typeGuard":"function hasPosts(v) {\n  return Array.isArray(v) && v.length > 0;\n}","tryCatchPattern":"try {\n  const posts = await bandPosts(bandId);\n} catch (e) {\n  if (e.name === 'EmptyResultError') {\n    return []; // treat as empty, not fatal\n  }\n  throw e;\n}","preventionTips":["Confirm the Band has visible posts with the same account before automating","Keep the session cookies fresh so private content is visible to the scraper","Handle EmptyResultError as an expected outcome in batch scripts"],"tags":["scraping","empty-result","band","session"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}