YmerNode.Mcp.Tools.Scripts.Errors (Ymer Node v0.2.1)

Copy Markdown View Source

Translates the scripts tool's error reasons into messages a worker can act on. Called by YmerNode.Mcp.Tools.Scripts's Wymcp.Tool.handle_error/1.

Every message names the next call rather than describing the fault: the reader is an agent deciding what to do next, not a person reading a log.

The set is the one YmerNode.Scripts.Runner's moduledoc tabulates, plus :not_found, the two documentation refusals — a build without the Docs chunk, a package name outside the promise — and the wrong-typed twins the action layer raises. It is deliberately not shared with YmerNode.Mcp.Tools.ScriptAuthor.Errors: nothing the compiler or acceptance refuses can reach this tool, because this tool compiles nothing and accepts nothing — the runner flattens the one compile failure it can see into the text of :not_loaded. A shared module would be a union neither tool fully uses.

Summary

Functions

format(reason, ctx \\ %{})

message(reason, arg2)