eyaltoledano/claude-task-master · error

NETWORK_ERROR

NETWORK_ERROR

Error message

Failed to connect to API: ${errorMessage}

What it means

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.

Source

Thrown at packages/tm-core/src/modules/integration/services/export.service.ts:1155

					}
				};
			}

			return {
				success: true,
				brief: result.brief,
				taskMapping: result.taskMapping,
				invitations: result.invitations,
				warnings: result.warnings
			};
		} catch (error) {
			const errorMessage =
				error instanceof Error ? error.message : String(error);

			return {
				success: false,
				error: {
					code: 'NETWORK_ERROR',
					message: `Failed to connect to API: ${errorMessage}`
				}
			};
		}
	}

	// ========== Generate Brief From PRD ==========

	/**
	 * Generate a new brief from PRD content
	 * Sends PRD to Hamster which creates a brief and generates tasks asynchronously
	 */
	async generateBriefFromPrd(
		options: GenerateBriefFromPrdOptions
	): Promise<GenerateBriefFromPrdResult> {
		if (!options.prdContent || options.prdContent.trim().length === 0) {
			return {
				success: false,

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Check basic connectivity (curl the API host) to distinguish local network vs remote outage.
  2. Connect VPN / disable restrictive proxy or firewall rules blocking the host.
  3. If the message mentions certificates, update the corporate CA bundle or NODE_EXTRA_CA_CERTS.
  4. Retry with backoff for transient resets; verify the Hamster status page for outages.

Example fix

try {
  await exportService.generateBriefFromTasks(opts);
} catch (e) {
  if (!navigator.onLine) await waitForNetwork(); // then retry
}
Defensive patterns

Strategy: retry

Validate before calling

const reachable = await fetch('https://api.hamster.example/health', { signal: AbortSignal.timeout(5000) }).then(r => r.ok).catch(() => false);
if (!reachable) throw new Error('API host unreachable - check network/VPN');

Type guard

function isNetworkError(r: GenerateBriefResult): r is GenerateBriefResult & { success: false; error: { code: 'NETWORK_ERROR' } } {
  return !r.success && r.error?.code === 'NETWORK_ERROR';
}

Try / catch

const result = await exportService.generateBriefFromTasks(opts);
if (!result.success && result.error?.code === 'NETWORK_ERROR') {
  await retryWithBackoff(() => exportService.generateBriefFromTasks(opts), { retries: 3 });
}

Prevention

When it happens

Trigger: fetch throws TypeError on DNS resolution failure, connection refused/reset, TLS certificate errors, request timeout/abort, or offline network during the generate-brief call.

Common situations: No internet/VPN down, firewall blocking api host, DNS misconfiguration, self-signed or expired certificates intercepted by corporate TLS inspection, or server temporarily unreachable.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/1b65ff33df81eff6. Report an issue: GitHub.