IF Commons GitHub

docs/problem

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0006-anyfs-documents FR-006

What a collection reports when it does not do what it was asked: a closed union, each a value with one sentence. A problem of the store is carried as it was, so that a conflict of a put is the conflict of the store and a caller reads one kind of conflict. What a listing finds wrong with an object is a finding, listed beside the good documents, never a failure of the listing.

import { describeDocProblem } from "./problem.ts";
describeDocProblem({ kind: "bad-key", detail: "x is not an identifier" }); // "the key has no path: x is not an identifier"

Source: commons/anyfs/src/docs/problem.ts

2 of 5 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

DocProblemtypeno test imports it
type DocProblem = | { readonly kind: "store"; readonly problem: Problem } | { readonly kind: "undecodable"; readonly… (450 characters)
type DocProblem =
  | { readonly kind: "store"; readonly problem: Problem }
  | { readonly kind: "undecodable"; readonly path: Path; readonly reason: CodecReason; readonly detail: string }
  | { readonly kind: "unencodable"; readonly detail: string }
  | { readonly kind: "bad-key"; readonly detail: string }
  | { readonly kind: "exhausted"; readonly path: Path; readonly attempts: number }
  | { readonly kind: "refused"; readonly detail: string };

What a collection reports: a closed union of six kinds.

storeProblemconstno test imports it
const storeProblem: (problem: Problem) => DocProblem

A problem of the store.

Findingtypeno test imports it
type Finding =
  | { readonly kind: "foreign"; readonly path: Path; readonly detail: string }
  | { readonly kind: "undecodable"; readonly path: Path; readonly reason: CodecReason; readonly detail: string }
  | { readonly kind: "unreadable"; readonly path: Path; readonly problem: Problem };

What a listing found about an object that is not a good document of the collection.

describeDocProblemfunction
function describeDocProblem(problem: DocProblem): string

A problem as one sentence.

Imported by 11 tests of the run (11 passed, 0 failed): the library's results

describeFindingfunction
function describeFinding(finding: Finding): string

A finding as one sentence.

Imported by 11 tests of the run (11 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.