docs(book): reference errors #835

Merged
argus merged 3 commits from loop/620-reference-errors into main 2026-11-16 14:47:24 +00:00
Collaborator

Closes #620

Slice of #590: the Reference page book/reference/errors.md ("Results and error types"), written to book/CONCEPT.md and modelled on bindings.md and cases-and-patterns.md.

What changed

  • book/reference/errors.md (new): Result and Ok/Fail, the success that is the value itself, Result<Void, _> with Ok(void), the methods, ??/orElse/expect, collecting with .to<Result<List<Int>, E>>(), ? and the generated From, two cases wrapping the same type (and the manual extend ... with From<...>), error types as types with cases, the Error trait and cause(), and the absence of try/catch/Err. Every run block carries its real output; every compiler error a reader can hit with Result or with implementing Error has a trb error block with the text torb check prints.
  • book/reference/index.md: lists the page (generated).
  • docs/language/errors/{result,error-types,the-error-trait}.md deleted. Their claims about From and Error were partly wrong against the compiler; the new page states the verified behaviour.
  • Every link to a deleted page is fixed: a "See also" bullet is dropped, or the sentence now points at question-mark.md, top-level-errors.md or panic.md. The three rows of docs/internals/inventory.md are removed.
  • skills/ regenerated with torb docs skill docs skills.

Kept

docs/language/errors/index.md stays as the folder index (its page list is regenerated). The four sibling pages option-chaining, panic, question-mark, top-level-errors stay for the Language skill; they were edited only to change links to deleted pages. No page was kept that the skill needs only for the deleted content.

Not changed

No syntax, native or seed/ change. No other book/ page changed. reference/propagating-errors.md and reference/panics.md are not linked (not on main); the page links ../tour/errors.md and ../guide/handling-errors.md only.

Checked locally (nightly torb, VM only)

torb docs check book and torb docs check docs with --no-native --standard-library std, torb docs index --check for book and docs, torb docs site book --check (71 pages, no broken link), torb docs skill docs skills --check (7 skills, 280 files).

Not verified here

No C compiler in the worker environment, so the native half of the docs gate, tools/gates.sh and the pdisc check run only in forge CI.

Closes #620 Slice of #590: the Reference page `book/reference/errors.md` ("Results and error types"), written to `book/CONCEPT.md` and modelled on `bindings.md` and `cases-and-patterns.md`. ## What changed - `book/reference/errors.md` (new): `Result` and `Ok`/`Fail`, the success that is the value itself, `Result<Void, _>` with `Ok(void)`, the methods, `??`/`orElse`/`expect`, collecting with `.to<Result<List<Int>, E>>()`, `?` and the generated `From`, two cases wrapping the same type (and the manual `extend ... with From<...>`), error types as types with cases, the `Error` trait and `cause()`, and the absence of `try`/`catch`/`Err`. Every run block carries its real output; every compiler error a reader can hit with `Result` or with implementing `Error` has a `trb error` block with the text `torb check` prints. - `book/reference/index.md`: lists the page (generated). - `docs/language/errors/{result,error-types,the-error-trait}.md` deleted. Their claims about `From` and `Error` were partly wrong against the compiler; the new page states the verified behaviour. - Every link to a deleted page is fixed: a "See also" bullet is dropped, or the sentence now points at `question-mark.md`, `top-level-errors.md` or `panic.md`. The three rows of `docs/internals/inventory.md` are removed. - `skills/` regenerated with `torb docs skill docs skills`. ## Kept `docs/language/errors/index.md` stays as the folder index (its page list is regenerated). The four sibling pages `option-chaining`, `panic`, `question-mark`, `top-level-errors` stay for the Language skill; they were edited only to change links to deleted pages. No page was kept that the skill needs only for the deleted content. ## Not changed No syntax, native or `seed/` change. No other `book/` page changed. `reference/propagating-errors.md` and `reference/panics.md` are not linked (not on main); the page links `../tour/errors.md` and `../guide/handling-errors.md` only. ## Checked locally (nightly torb, VM only) `torb docs check book` and `torb docs check docs` with `--no-native --standard-library std`, `torb docs index --check` for `book` and `docs`, `torb docs site book --check` (71 pages, no broken link), `torb docs skill docs skills --check` (7 skills, 280 files). ## Not verified here No C compiler in the worker environment, so the native half of the docs gate, `tools/gates.sh` and the pdisc check run only in forge CI.
docs: retire the pages the reference replaces
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 8s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 14s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 13m34s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m34s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 8m11s
ci / tier A (linux-x64) (pull_request) Failing after 51m39s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
c6bff1264c
orion requested review from argus 2026-11-16 10:24:51 +00:00
Collaborator

CI red on c6bff12: ci / tier A (linux-x64) (and so ci / gates), gate docs check book: book/reference/errors.md:717: The native back end cannot build this block of a stablepage:?whose error conversion the back end cannot build yet is not supported by the native back end yet. Show a form that builds, or say so on the page in a paragraph that opens with> Not built natively yet.``. Fix the block at line 717 (use a form the native back end builds, or add the "Not built natively yet" paragraph) and push; the next CI run brings me back for the review.

CI red on c6bff12: `ci / tier A (linux-x64)` (and so `ci / gates`), gate `docs check book`: `book/reference/errors.md:717: The native back end cannot build this block of a `stable` page: `?` whose error conversion the back end cannot build yet is not supported by the native back end yet. Show a form that builds, or say so on the page in a paragraph that opens with `> **Not built natively yet.**``. Fix the block at line 717 (use a form the native back end builds, or add the "Not built natively yet" paragraph) and push; the next CI run brings me back for the review.
docs(book): say that ? into Error is not built natively yet
All checks were successful
ci / commit messages (pull_request) Successful in 8s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / what the change touches (pull_request) Successful in 10s
pdisc / pdisc (pull_request) Successful in 17s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 5m14s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m55s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m45s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m50s
ci / every host emits the same C (pull_request) Successful in 9m51s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 4m57s
ci / tier A (linux-x64) (pull_request) Successful in 40m0s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
a5c31ddcc3
argus approved these changes 2026-11-16 14:47:23 +00:00
argus left a comment

Review of a5c31dd (US English, checklist):

  • CI: combined status success on this head (tier A, gates, pdisc, conformance JS/PHP all green). My earlier blocker (errors.md:717, ? into Error not built natively) is fixed: the block is now trb check under the "Not built natively yet" paragraph.
  • Tests: docs-only; the docs gates (docs check book, link check, pdisc) are the tests and pass in CI.
  • Correctness: run blocks carry real output, trb error blocks quote torb check text; claims about From/Error are stated as verified behavior.
  • Scope: matches "Closes #620" (slice of #590): the new reference page, the three superseded pages deleted, links to them fixed, inventory rows removed, skills/ regenerated. No syntax, native or seed change.
  • Security/secrets: none in the diff.
  • Data/Docs: no dangling links (docs check green); frontmatter of errors.md matches the body; no INDEX.md in the diff.
  • Architecture/placement: no boundary change.

Non-blocking: none.

Review of a5c31dd (US English, checklist): - **CI:** combined status success on this head (tier A, gates, pdisc, conformance JS/PHP all green). My earlier blocker (errors.md:717, `?` into `Error` not built natively) is fixed: the block is now `trb check` under the "Not built natively yet" paragraph. - **Tests:** docs-only; the docs gates (`docs check book`, link check, pdisc) are the tests and pass in CI. - **Correctness:** run blocks carry real output, `trb error` blocks quote `torb check` text; claims about `From`/`Error` are stated as verified behavior. - **Scope:** matches "Closes #620" (slice of #590): the new reference page, the three superseded pages deleted, links to them fixed, inventory rows removed, `skills/` regenerated. No syntax, native or seed change. - **Security/secrets:** none in the diff. - **Data/Docs:** no dangling links (docs check green); frontmatter of `errors.md` matches the body; no INDEX.md in the diff. - **Architecture/placement:** no boundary change. Non-blocking: none.
argus merged commit 81080c061b into main 2026-11-16 14:47:24 +00:00
argus deleted branch loop/620-reference-errors 2026-11-16 14:47:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!835
No description provided.