gitbutlerapp/gitbutler · info

SilentError suppressed from query:error telemetry

Error message

SilentError suppressed from query:error telemetry

What it means

emitQueryError classifies query errors via parseQueryError and forwards them to PostHog telemetry. Errors whose name is SilentError are intentional, expected conditions — cancellations and known-ignorable states — so the function warns to the console and returns before any telemetry capture. Seeing this message means a SilentError reached a query:error handler, exactly as designed.

Source

Thrown at apps/desktop/src/lib/error/error.ts:151

	return {
		name,
		message,
		code,
	};
}

export function emitQueryError(
	posthog: PostHogWrapper | undefined,
	error: unknown,
	context?: {
		command?: string;
		actionName?: string;
		severity?: "error" | "warning" | "silent";
	},
) {
	const { name, message, code } = parseQueryError(error);
	if (name === "SilentError") {
		console.warn("SilentError suppressed from query:error telemetry", error);
		return;
	}
	// Errors classified `silent` are expected states (offline network blips,
	// known noise), not defects — keep them out of error telemetry.
	if (context?.severity === "silent") return;
	if (!posthog) return;
	const key = `${context?.command ?? ""}|${name}`;
	if (!shouldCaptureQueryError(key)) return;
	posthog.capture(QUERY_ERROR_EVENT_NAME, {
		error_title: name,
		error_message: message,
		error_code: code,
		command: context?.command,
		actionName: context?.actionName,
		severity: context?.severity,
	});
}

View on GitHub (pinned to caf1f223d3)

Solutions

  1. Treat the message as expected bookkeeping — no action needed for genuine cancellations
  2. If the console noise distracts during development, downgrade the warn to console.debug locally
  3. If the error should actually be tracked, rename the throwing class away from SilentError so it stops matching the suppression branch
  4. Double-check context.severity for errors that should be telemetry-silent without being SilentError
Defensive patterns

Strategy: type-guard

Type guard

function isSilentError(error: unknown): boolean {
	return error instanceof Error && error.name === "SilentError";
}

Try / catch

try {
	await runSomeQuery();
} catch (error) {
	if (isSilentError(error)) return; // expected cancellation — skip handling
	handleRealError(error);
}

Prevention

When it happens

Trigger: A Svelte query or mutation rejects with an error whose name is 'SilentError' (for example new SilentError('user cancelled')); emitQueryError detects name === "SilentError" at apps/desktop/src/lib/error/error.ts:151, logs the suppression, and skips capture.

Common situations: Cancellation-heavy flows (dialogs dismissed, operations superseded); accidentally naming an unrelated error class SilentError; debugging why a failure never appears in PostHog.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20). Data as JSON: /api/errors/014db1f103f6e1c7. Report an issue: GitHub.