MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / formatErrorMessage

Function formatErrorMessage

packages/core/src/constraints/parser.ts:58–64  ·  view source on GitHub ↗
(source: string, detail: string, position: number)

Source from the content-addressed store, hash-verified

56}
57
58function formatErrorMessage(source: string, detail: string, position: number): string {
59 const clamped = Number.isFinite(position)
60 ? Math.min(Math.max(0, Math.trunc(position)), source.length)
61 : 0;
62 const caret = `${" ".repeat(8 + clamped)}^`;
63 return `${detail} at position ${String(clamped)}\n expr("${source}")\n${caret}`;
64}
65
66export class ConstraintSyntaxError extends Error {
67 readonly source: string;

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected