CliSubprocessCore.ProcessExit (CliSubprocessCore v0.2.0)

Copy Markdown View Source

Facade helpers for normalized process exits returned by core-owned lanes.

Downstream SDKs should use this module instead of importing lower ExecutionPlane.* process-exit modules directly. The current runtime representation is intentionally opaque to product repos.

Summary

Functions

Returns the normalized integer exit code, when present.

Normalizes a raw exit reason through the core facade.

Returns true when term is the process-exit representation used by the core.

Returns the original normalized reason, when present.

Returns the normalized signal, when present.

Returns the normalized exit status, or nil for non-exit terms.

Returns stderr carried on the exit, when present.

Returns true when the normalized exit represents success.

Projects the process exit to a map without exposing the lower module name.

Types

status()

@type status() :: :success | :exit | :signal | :error

t()

@opaque t()

Functions

code(arg1)

@spec code(term()) :: non_neg_integer() | nil

Returns the normalized integer exit code, when present.

from_reason(reason, opts \\ [])

@spec from_reason(
  term(),
  keyword()
) :: t()

Normalizes a raw exit reason through the core facade.

match?(arg1)

@spec match?(term()) :: boolean()

Returns true when term is the process-exit representation used by the core.

reason(term)

@spec reason(term()) :: term()

Returns the original normalized reason, when present.

signal(arg1)

@spec signal(term()) :: atom() | integer() | nil

Returns the normalized signal, when present.

status(arg1)

@spec status(term()) :: status() | nil

Returns the normalized exit status, or nil for non-exit terms.

stderr(arg1)

@spec stderr(term()) :: String.t() | nil

Returns stderr carried on the exit, when present.

successful?(exit)

@spec successful?(term()) :: boolean()

Returns true when the normalized exit represents success.

to_map(exit)

@spec to_map(term()) :: map()

Projects the process exit to a map without exposing the lower module name.