Beancount.Result (beancount_ex v0.6.0)

Copy Markdown View Source

Normalized result of running a Beancount check.

A Result is engine-agnostic: the CLI engine and any future native engine populate the same struct so callers never need to special-case the backend.

Fields:

  • :status - :ok when the ledger is valid, :error otherwise.
  • :exit_status - the raw process exit status (nil for non-process engines).
  • :stdout - captured standard output (CLI engines merge stderr here).
  • :stderr - unused; kept for struct symmetry. CLI output is merged into :stdout via stderr_to_stdout: true.
  • :normalized - engine-independent, structured view of the output produced by Beancount.Normalizer.

Summary

Types

status()

@type status() :: :ok | :error

t()

@type t() :: %Beancount.Result{
  exit_status: non_neg_integer() | nil,
  normalized: map(),
  status: status() | nil,
  stderr: binary(),
  stdout: binary()
}