CLI command
skarbiec errors
Print every way a Skarbiec functionality can fail, as each functionality declares it in src/failures, and hold that catalogue to the error standard.
Invocation#
skarbiec errors list [--markdown]
skarbiec errors show <functionality>
skarbiec errors check [--repository <dir>] [--baseline <file>]Purpose#
Print every way a Skarbiec functionality can fail, as each functionality declares it in src/failures, and hold that catalogue to the error standard.
Required inputs and options#
- list takes nothing; --markdown prints the documentation page /docs/errors is made from instead of JSON. show takes one functionality id, such as skarbiec.status or skarbiec.import. check takes --repository <dir>, a checkout in which every cause's declared test is looked up (its tests/untested-causes.json excuses the ones that cannot be provoked on a host, each with why), and --baseline <file>, a JSON list of the commands still allowed to have no catalogue; it may only shrink. POST /v1/operator/errors takes an optional functionality.
Output and state effects#
- list prints ok, docs and functionalities, each functionality with its entries, the functionalities it uses, its summary and its causes, every cause with its code, exit status, test and documentation anchor. show prints the functionality and met: every cause it can meet, its own and those of the functionalities it uses, each with declared_by. check prints ok, functionalities, causes, uncatalogued_commands and findings: a malformed declaration, a problem only the whole catalogue shows, an operator route entry naming a method other than POST, a declared test the repository neither holds nor excuses, a command no functionality names that the baseline does not allow, and a baseline entry no longer needed. It reads no vault and writes nothing. Desktop's Settings → Errors reads the same catalogue through the route.
Refusals#
- Every refusal is a declared cause of skarbiec.errors or, for its flags, skarbiec.arguments under /docs/errors. A form other than list, show <functionality> or check is form-unknown, exit 2: `errors <given> is not one of its forms`. A flag other than --markdown, --repository and --baseline is arguments-flag-unknown, exit 2: `errors takes no --<flag>, so it cannot do what the flag asks`; it used to be ignored. An id no functionality declares is functionality-unknown, exit 2, naming every declared one. A baseline that cannot be read, or is not a JSON list of command names, is baseline-unreadable or baseline-malformed, exit 2. A tests/untested-causes.json that cannot be read, or is not an object from a declared test to why it cannot be provoked, is untested-unreadable or untested-malformed, exit 1. Findings are printed as the answer and the run exits 1 (findings).
- skarbiec.errors form-unknown — exit 2: reading what skarbiec errors is asked; fix: run skarbiec errors list, skarbiec errors show <functionality> or skarbiec errors check
- skarbiec.errors functionality-unknown — exit 2: showing the failure catalogue of {id}; fix: name one of the declared functionalities; skarbiec errors list prints them
- skarbiec.errors baseline-unreadable — exit 2: reading the uncatalogued-command baseline {path}; fix: name the baseline file the repository holds, ci/errors-baseline.json
- skarbiec.errors baseline-malformed — exit 2: reading the uncatalogued-command baseline {path}; fix: write it as a JSON list of the command names still uncatalogued, e.g. ["status", "doctor"]; skarbiec errors check prints them as uncatalogued_commands
- skarbiec.errors untested-unreadable — exit 1: reading the untested-cause list {path}; fix: let this account read {path}, or name the checkout root with --repository
- skarbiec.errors untested-malformed — exit 1: reading the untested-cause list {path}; fix: write {path} as one JSON object whose keys are declared tests (tests/<area>/<file>::<test>) and whose values say why each cannot be provoked locally
- skarbiec.errors findings — exit 1: checking the failure catalogue; fix: fix each finding as it says: correct the declaration in src/failures, write the declared test or list it in tests/untested-causes.json with why, declare the command's failures, or remove it from the baseline
- skarbiec.errors errors-declaration-unreadable — exit 1: listing how {id} fails; fix: install a skarbiec build whose wisent-errors renders declarations as JSON (the skarbiec release installer at stado://releases/skarbiec/<version>/<platform>/install.sh)