diegosouzapw/OmniRoute · error
unknown mode
Error message
unknown mode: ${String(mode)} What it means
ccrQuery mode dispatch default: queryBlock received a q.mode value outside the known set (full/head/tail/lines/grep/stats) — typically a typo like 'heads' or 'first'. The switch falls through to this unknown-mode error.
Solutions
- Use one of: full, head, tail, lines, grep, stats
- Omit mode — it defaults to 'full'
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at open-sse/services/compression/engines/ccr/ccrQuery.ts:108 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/5d0858aa3d681fa3.
Report an issue: GitHub.
Appendix: source
Thrown at open-sse/services/compression/engines/ccr/ccrQuery.ts:108
}
export function queryBlock(text: string, q: CcrQuery): CcrQueryResult {
const mode = q.mode ?? "full";
if (mode === "full") return ok(text);
const lines = text.split("\n");
switch (mode) {
case "head":
return sliceHead(lines, q.n);
case "tail":
return sliceTail(lines, q.n);
case "lines":
return sliceLines(lines, q.start, q.end);
case "grep":
return grepLines(lines, q.pattern, q.unique);
case "stats":
return blockStats(text, lines);
default:
return err(`unknown mode: ${String(mode)}`);
}
}
View on GitHub (pinned to a179ffed5b)