Files
ww/lib/errors/errors.ww
Hojun-Cho 2243849855 lib+test: unify errors to Hare named-void tagged-union
Five tags from ref/hare/errors/common.ha — invalid, noaccess, noentry,
exists, unsupported — all !void. lib/io keeps eof/closed as plain void
(no Hare analogue for ww's singleton-style done) and adds underread.
Drops errors.equal/isnil and the old str-sentinel surface.
2026-05-13 20:19:03 +09:00

26 lines
923 B
Plaintext

// errors — domain-agnostic error types. Mirrors ref/hare/errors/.
//
// Named-void tagged-union variants, so `(T | errors.invalid | ...)`
// composes with every other module's error surface at the tag level.
// Per-domain errors (io.eof, io.closed, io.underread, strconv.overflow,
// ...) live in their own modules; this module ships only the generic
// conditions Hare's errors:: exports.
//
// Subset shipped today; add more from Hare's errors/common.ha as callers
// need them.
// A function was called with an invalid combination of arguments.
export type invalid = !void;
// The user does not have permission to use this resource.
export type noaccess = !void;
// An entry was requested which does not exist.
export type noentry = !void;
// An attempt was made to create a resource which already exists.
export type exists = !void;
// The requested operation is not supported.
export type unsupported = !void;