Documentation
¶
Overview ¶
Package fserrors maps filesystem errnos to codemeld's canonical error-category vocabulary.
OP_FAIL formatting, control-character collapse, and the stderr fallback channel for un-renderable errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollapseControls ¶
CollapseControls replaces newlines, carriage returns, and tabs with single spaces, then collapses runs of spaces to one, yielding a single line.
func FormatOpFail ¶
FormatOpFail returns the canonical OP_FAIL line:
codemeld: <operation> failed: <target_path>: <error_category>
operation and targetPath are run through CollapseControls; the result has no trailing newline.
func WriteToStderr ¶
WriteToStderr is the single chokepoint for errors that cannot be rendered in the TUI. It writes the OP_FAIL line and an optional collapsed detail continuation to os.Stderr. It does not call os.Exit, so the caller chooses the exit code.
Types ¶
type Category ¶
type Category string
func CategorizeErrno ¶
CategorizeErrno extracts a wrapped syscall.Errno from err and maps it to a Category. Unknown errnos and nil-wrapped errors return IOError.