CliSubprocessCore.TransportError (CliSubprocessCore v0.2.0)

Copy Markdown View Source

Facade helpers for transport errors returned by core-owned lanes.

Product SDKs should use this module to classify and project transport errors instead of matching lower ExecutionPlane.* structs directly.

Summary

Functions

Returns transport context, or an empty map for non-errors.

Returns true when term is the transport-error representation used by the core.

Returns the transport error message, or an inspected fallback.

Returns the normalized transport reason, or the original term for non-errors.

Projects the transport error to a map without exposing the lower module name.

Builds a normalized transport error through the core facade.

Types

reason()

@type reason() ::
  :not_connected
  | :timeout
  | :transport_stopped
  | {:unsupported_capability, atom(), atom()}
  | {:bridge_protocol_error, term()}
  | {:bridge_remote_error, term(), term()}
  | {:buffer_overflow, pos_integer(), pos_integer()}
  | {:send_failed, term()}
  | {:call_exit, term()}
  | {:command_not_found, String.t() | atom()}
  | {:cwd_not_found, String.t()}
  | {:invalid_options, term()}
  | {:startup_failed, term()}
  | term()

t()

@opaque t()

Functions

context(arg1)

@spec context(term()) :: map()

Returns transport context, or an empty map for non-errors.

match?(arg1)

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

Returns true when term is the transport-error representation used by the core.

message(term)

@spec message(term()) :: String.t()

Returns the transport error message, or an inspected fallback.

reason(term)

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

Returns the normalized transport reason, or the original term for non-errors.

to_map(error)

@spec to_map(term()) :: %{reason: term(), message: String.t(), context: map()}

Projects the transport error to a map without exposing the lower module name.

transport_error(reason, context \\ %{})

@spec transport_error(reason(), map()) :: t()

Builds a normalized transport error through the core facade.