Engine Page Resolution Errors (core/engine-errors.ts)

gbrain · src/core/engine-errors.ts · typescript · MIT
database, infra, lang:typescript, tag:error-handling, tag:core, tag:logic

Provides typed error handling for failed page resolutions in graph mutations. Use this to ensure consistent error reporting across different engine implementations.

// Source: https://github.com/garrytan/gbrain | License: MIT | Copyright 2026 Garry Tan
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Typed engine errors shared by both engine implementations. Lives outside
 * engine.ts (the interface module) for the same circular-import reason as
 * engine-constants.ts.
 *
 * #4109: the graph mutations (addLink / addTimelineEntry) resolve their page
 * endpoints inside the mutation statement, so a miss must identify WHICH
 * endpoint failed. The operations layer reclassifies these misses into the
 * caller-facing error envelope (permission_denied vs page_not_found) by
 * `instanceof` — never by message-prefix matching, which silently stops
 * firing when a message is reworded. The message is built HERE so both
 * engines stay in 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key