{"record":{"id":"a5fb73eca397f881","repo":"garrytan/gstack","slug":"daemon-refused-publish-errtext","errorCode":null,"errorMessage":"Daemon refused publish: ${errText}","messagePattern":"Daemon refused publish: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"design/src/daemon-client.ts","lineNumber":211,"sourceCode":"  if (opts.title) body.title = opts.title;\n  const resp = await fetch(`http://127.0.0.1:${opts.port}/api/boards`, {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify(body),\n  });\n  if (!resp.ok) {\n    let errText: string;\n    try {\n      const j = (await resp.json()) as { error?: string; existing?: { id: string; url: string } };\n      if (j.existing) {\n        // 409: surface the existing-board URL so the caller can reuse it\n        return { id: j.existing.id, url: j.existing.url, sourceDir: \"\" };\n      }\n      errText = j.error || `HTTP ${resp.status}`;\n    } catch {\n      errText = `HTTP ${resp.status}`;\n    }\n    throw new Error(`Daemon refused publish: ${errText}`);\n  }\n  return (await resp.json()) as PublishBoardResult;\n}\n\n// ─── Internals ───────────────────────────────────────────────────\n\nfunction readPackageVersion(): string {\n  return readVersionString();\n}\n\nfunction defaultDaemonScript(): string {\n  // design/src/daemon-client.ts → daemon.ts is a sibling. Only used in dev\n  // when this process is `bun run cli.ts`; the compiled-binary path\n  // self-execs instead (see resolveSpawnCommand).\n  return path.join(import.meta.dir, \"daemon.ts\");\n}\n\n/**","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/design/src/daemon-client.ts#L193-L229","documentation":"Error \"Daemon refused publish: ${errText}\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at design/src/daemon-client.ts:211 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"}