{"record":{"id":"1b65ff33df81eff6","repo":"eyaltoledano/claude-task-master","slug":"network-error","errorCode":"NETWORK_ERROR","errorMessage":"Failed to connect to API: ${errorMessage}","messagePattern":"Failed to connect to API: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/integration/services/export.service.ts","lineNumber":1155,"sourceCode":"\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tbrief: result.brief,\n\t\t\t\ttaskMapping: result.taskMapping,\n\t\t\t\tinvitations: result.invitations,\n\t\t\t\twarnings: result.warnings\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconst errorMessage =\n\t\t\t\terror instanceof Error ? error.message : String(error);\n\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'NETWORK_ERROR',\n\t\t\t\t\tmessage: `Failed to connect to API: ${errorMessage}`\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// ========== Generate Brief From PRD ==========\n\n\t/**\n\t * Generate a new brief from PRD content\n\t * Sends PRD to Hamster which creates a brief and generates tasks asynchronously\n\t */\n\tasync generateBriefFromPrd(\n\t\toptions: GenerateBriefFromPrdOptions\n\t): Promise<GenerateBriefFromPrdResult> {\n\t\tif (!options.prdContent || options.prdContent.trim().length === 0) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,","sourceCodeStart":1137,"sourceCodeEnd":1173,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/integration/services/export.service.ts#L1137-L1173","documentation":"The fetch call in callGenerateBriefEndpoint throws (network-level failure before/without an HTTP response) and the catch block returns a NETWORK_ERROR result wrapping the raw error message. This is a transport failure, not an API response - DNS, TCP, TLS, or an aborted request.","triggerScenarios":"fetch throws TypeError on DNS resolution failure, connection refused/reset, TLS certificate errors, request timeout/abort, or offline network during the generate-brief call.","commonSituations":"No internet/VPN down, firewall blocking api host, DNS misconfiguration, self-signed or expired certificates intercepted by corporate TLS inspection, or server temporarily unreachable.","solutions":["Check basic connectivity (curl the API host) to distinguish local network vs remote outage.","Connect VPN / disable restrictive proxy or firewall rules blocking the host.","If the message mentions certificates, update the corporate CA bundle or NODE_EXTRA_CA_CERTS.","Retry with backoff for transient resets; verify the Hamster status page for outages."],"exampleFix":"try {\n  await exportService.generateBriefFromTasks(opts);\n} catch (e) {\n  if (!navigator.onLine) await waitForNetwork(); // then retry\n}","handlingStrategy":"retry","validationCode":"const reachable = await fetch('https://api.hamster.example/health', { signal: AbortSignal.timeout(5000) }).then(r => r.ok).catch(() => false);\nif (!reachable) throw new Error('API host unreachable - check network/VPN');","typeGuard":"function isNetworkError(r: GenerateBriefResult): r is GenerateBriefResult & { success: false; error: { code: 'NETWORK_ERROR' } } {\n  return !r.success && r.error?.code === 'NETWORK_ERROR';\n}","tryCatchPattern":"const result = await exportService.generateBriefFromTasks(opts);\nif (!result.success && result.error?.code === 'NETWORK_ERROR') {\n  await retryWithBackoff(() => exportService.generateBriefFromTasks(opts), { retries: 3 });\n}","preventionTips":["Check connectivity/VPN before long export runs","Configure NODE_EXTRA_CA_CERTS for corporate TLS-inspecting proxies","Use timeouts plus exponential backoff retries for transient resets","Subscribe to Hamster status updates for outage awareness"],"tags":["network","http","connectivity","api"],"backgroundTag":"failed-to-connect","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}