noggin

Errors

Every failure noggin surfaces is either a NogginError (thrown by the engine + providers) or wrapped as one at a boundary. Three pieces:

Host-side rendering

The engine's message is a short host-neutral string suitable for logs and fallback. Hosts that render errors to users go through their own catalog, keyed on code:

Each catalog reads the data payload for context (path, title, counts) and returns a string appropriate for the host's vocabulary — the CLI speaks --flag, the UI speaks "tree" and "menu".

Wire boundaries

For CLI --json output, MCP tool responses, and noggin-rpc verb errors, engine NogginErrors are wrapped in an ErrorEnvelope by formatError(). The envelope preserves code + exitCode + data verbatim, so downstream consumers pattern-match identically to in-process callers.