{"record":{"id":"6d8e5050bb985698","repo":"coleam00/Archon","slug":"marketplace-fetch-failed-http-string-res-status","errorCode":null,"errorMessage":"Marketplace fetch failed: HTTP ${String(res.status)} from ${url}","messagePattern":"Marketplace fetch failed: HTTP (.+?) from (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":4996,"sourceCode":"  sha: string;\n  tags: string[];\n  archonVersionCompat: string;\n  featured?: boolean;\n}\n\nconst DEFAULT_MARKETPLACE_URL = 'https://archon.diy/workflows.json';\n\nasync function fetchMarketplace(): Promise<MarketplaceEntryJson[]> {\n  const url = process.env.ARCHON_MARKETPLACE_URL ?? DEFAULT_MARKETPLACE_URL;\n  let res: Response;\n  try {\n    res = await fetch(url);\n  } catch (error) {\n    const err = error as Error;\n    throw new Error(`Cannot reach marketplace at ${url}: ${err.message}`);\n  }\n  if (!res.ok) {\n    throw new Error(`Marketplace fetch failed: HTTP ${String(res.status)} from ${url}`);\n  }\n  const raw: unknown = await res.json();\n  if (!Array.isArray(raw)) {\n    throw new Error('Unexpected marketplace response format (expected array)');\n  }\n  for (const item of raw) {\n    if (\n      typeof item !== 'object' ||\n      item === null ||\n      typeof (item as Record<string, unknown>).slug !== 'string' ||\n      typeof (item as Record<string, unknown>).sourceUrl !== 'string' ||\n      !Array.isArray((item as Record<string, unknown>).tags)\n    ) {\n      throw new Error('Marketplace response contains invalid entries');\n    }\n  }\n  return raw as MarketplaceEntryJson[];\n}","sourceCodeStart":4978,"sourceCodeEnd":5014,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L4978-L5014","documentation":"Error \"Marketplace fetch failed: HTTP ${String(res.status)} from ${url}\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/cli/src/commands/workflow.ts:4996 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":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}