GeminiCliSdk.Error exception (gemini_cli_sdk v0.2.0)

Copy Markdown View Source

Unified error type for the Gemini CLI SDK.

Summary

Types

kind()

@type kind() ::
  :cli_not_found
  | :command_failed
  | :command_timeout
  | :command_execution_failed
  | :stream_start_failed
  | :stream_timeout
  | :transport_error
  | :transport_exit
  | :parse_error
  | :json_decode_error
  | :unknown_event_type
  | :invalid_event
  | :invalid_configuration
  | :config_invalid
  | :execution_failed
  | :no_result
  | :auth_error
  | :input_error
  | :config_error
  | :user_cancelled
  | :unknown

t()

@type t() :: %GeminiCliSdk.Error{
  __exception__: true,
  cause: term(),
  context: map() | nil,
  details: String.t() | nil,
  exit_code: integer() | nil,
  kind: kind(),
  message: String.t()
}

Functions

from_exit_code(code)

@spec from_exit_code(integer()) :: :ok | t()

from_runtime_failure(failure, opts \\ [])

@spec from_runtime_failure(
  CliSubprocessCore.ProviderCLI.ErrorRuntimeFailure.t(),
  keyword()
) :: t()

new(opts)

@spec new(keyword()) :: t()

normalize(error, opts)

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