Reference

Exit codes

Twenty-six classes, plus a timeout that is not a failure.

Every failure returns a nonzero exit status, a concise message on stderr, and — with --json — a structured error carrying a stable code.

Exit statuses are stable and are part of the interface. Branch on the status or the code, never on the message.

ExitCodeMeaning
1internal_errorUnexpected internal failure.
2invalid_argumentsUnparsable or contradictory arguments.
3display_unavailableThe X11 display could not be opened.
4invalid_regionRegion is malformed, zero sized, or out of bounds.
5window_not_foundThe requested window does not exist.
6capture_failedThe backend could not produce a frame.
7resize_failedThe requested resize could not be performed.
8encode_failedPNG or JPEG encoding failed.
9output_failedWriting the result failed.
10incompatible_framesThe two frames cannot be compared.
11comparison_failedThe comparison could not be performed.
12image_load_failedAn input image could not be read or decoded.
13geometry_changedThe observed target changed shape or moved.
14target_lostThe observed target disappeared.
15invalid_durationA duration was zero, negative, or unparsable.
16observation_failedThe observation could not be performed.
17session_not_foundThe session is not registered — closed, or the service restarted.
18session_busyThe session is running an observation; a second one, or a close, was refused.
19session_closedThe session has been closed.
20frame_not_availableThe requested frame ID is not retained, or was never captured.
21no_frame_availableThe session has not captured any frame yet.
22service_unavailableNo `eensh serve` could be reached at the socket path.
23service_protocol_errorThe service could not decode a request, or a protocol version was refused.
24service_overloadedThe service refused work to preserve freshness.
25invalid_presentation_policyThe presentation policy is malformed or self-contradictory.
26payload_budget_exceededThe required views cannot fit in the requested budget, even at their floors.
100—Timeout: the observation ran, the condition did not occur.

Errors cross the process boundary unchanged

A service error is mapped back to the status it would have had on the standalone path. A frame_not_available from a session exits 20, exactly as the standalone equivalent would — so this table stays a single source of truth whether or not a service is involved.

For the grouped-by-decision view, with notes on how to react to each class, see errors that guide you.

Presentation additions

Two codes were added with the presentation layer, and both are caller errors rather than environmental ones:

  • 25 invalid_presentation_policy — a malformed or self-contradictory policy: a zero-sized region, a duplicate region name, a region named overview, or a policy requesting no image at all. Refused before any capture is attempted.
  • 26 payload_budget_exceeded — a budget that cannot hold the required views. The message quotes the smallest achievable payload, so the caller has a number to work up from.