logical.Contexttypeno test imports ittype Context = { readonly op: PlanOp; readonly creating?: boolean };What the operation was doing when the store said it: the operation, and whether it was making an object where there was none.
What a store's problem is, as a code of POSIX: a total table from the five kinds of problem (and the seven reasons of a refusal) to the code a local file system would have given. Where the same problem means two things the operation decides: a write that expected no object and found one is EEXIST where it made a file and ESTALE where it was to replace what it had read.
import { errnoOf } from "./errno-table.ts";
import { missing, parsePath } from "@intellectual-frontiers/anyfs/governance";
const p = parsePath("a");
p.kind === "ok" && errnoOf(missing(p.value), { op: "read-all" }); // "ENOENT"logical.Contexttypeno test imports ittype Context = { readonly op: PlanOp; readonly creating?: boolean };What the operation was doing when the store said it: the operation, and whether it was making an object where there was none.
logical.errnoOffunctionno test imports itfunction errnoOf(problem: Problem, context: Context): "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV"The code of a problem.
Contexttypeno test imports ittype Context = { readonly op: PlanOp; readonly creating?: boolean };What the operation was doing when the store said it: the operation, and whether it was making an object where there was none.
errnoOffunctionfunction errnoOf(problem: Problem, context: Context): "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV"The code of a problem.