ExternalRuntimeTransport.Transport.Error exception (ExternalRuntimeTransport v0.1.0)

Copy Markdown View Source

Structured transport error with a normalized reason and debugging context.

Summary

Functions

Builds a bridge-protocol error.

Builds a bridge-remote error.

Builds a buffer overflow error with preview metadata.

Builds a call-exit error.

Builds a command-not-found error.

Builds a cwd-not-found error.

Builds an invalid-options error.

Builds a not-connected error.

Builds a send failure error.

Builds a startup-failed error.

Builds a timeout error.

Builds a generic transport error.

Builds a transport-stopped error.

Builds an unsupported-capability error.

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()

@type t() :: %ExternalRuntimeTransport.Transport.Error{
  __exception__: true,
  context: map(),
  message: String.t(),
  reason: reason()
}

Functions

bridge_protocol_error(reason)

@spec bridge_protocol_error(term()) :: t()

Builds a bridge-protocol error.

bridge_remote_error(code, details)

@spec bridge_remote_error(term(), term()) :: t()

Builds a bridge-remote error.

buffer_overflow(actual_size, max_size, preview, context \\ %{})

@spec buffer_overflow(pos_integer(), pos_integer(), binary(), map()) :: t()

Builds a buffer overflow error with preview metadata.

call_exit(reason)

@spec call_exit(term()) :: t()

Builds a call-exit error.

command_not_found(command, cause \\ nil)

@spec command_not_found(String.t() | atom(), term()) :: t()

Builds a command-not-found error.

cwd_not_found(cwd)

@spec cwd_not_found(String.t()) :: t()

Builds a cwd-not-found error.

invalid_options(reason)

@spec invalid_options(term()) :: t()

Builds an invalid-options error.

not_connected()

@spec not_connected() :: t()

Builds a not-connected error.

send_failed(reason)

@spec send_failed(term()) :: t()

Builds a send failure error.

startup_failed(reason)

@spec startup_failed(term()) :: t()

Builds a startup-failed error.

timeout()

@spec timeout() :: t()

Builds a timeout error.

transport_error(reason, context \\ %{})

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

Builds a generic transport error.

transport_stopped()

@spec transport_stopped() :: t()

Builds a transport-stopped error.

unsupported_capability(capability, surface_kind)

@spec unsupported_capability(atom(), atom()) :: t()

Builds an unsupported-capability error.