For agents
Exit codes for agents
What the exit code of ormaos run and of a reading verb tells an agent, and where the reason is.
ormaos run returns the command's code#
ormaos run -- <command> exits with the exit code of the command, whatever was or was not recorded. An agent can put ormaos run -- in front of a command without changing how it checks the result.
$ ormaos run -- python three.py
ormaos: r2 exit 3 in …: 1 Python process, 1 call, 1 exception (0 swallowed)
ormaos: saved in .ormaos/r2, next: ormaos tree r2:c1A command ended by a signal gives 128 plus the signal number, as a shell reports it:
$ ormaos run -- python term.py
ormaos: r3 (incomplete) exit 143 (signal 15) in …: 1 Python process, 1 call, 0 exceptions
ormaos: not collected: the last events of process …: it was ended by the program (process 1) with signal 15 before it had written everything: what it wrote is here, the calls that had not returned are marked open, and up to 256 records or what happened in its last 0.2 seconds can be missing
ormaos: saved in .ormaos/r3, next: ormaos tree r3:c1The recording is then (incomplete), and not collected says which process may miss its last events.
When the command cannot be started, ormaos run exits with 127 (not found) or 126 (not runnable), and nothing is recorded:
$ ormaos run -- no-such-program
ormaos: cannot start 'no-such-program' (FileNotFoundError)A reading verb: 0, 1 or 2#
| Code | Meaning |
|---|---|
0 | it answered |
1 | the question has no answer: no such recording or address, nothing recorded there, a recording that cannot be read |
2 | the command line was not understood |
The reason is on stderr, or in the JSON document with --json.
$ ormaos path r1
ormaos: no path in r1: lines are recorded only inside a scope given when recording
ormaos: next: ormaos run --path ok.py -- python ok.pyAn option is written in full: --lim is not --limit.
$ ormaos tree --lim 5
usage: ormaos [-h] [--version] <verb> ...
ormaos: error: unrecognized arguments: --limThe full table, with every case, is in Exit codes.