Exception: ClaudeSDK::CLINotFoundError

Inherits:
CLIConnectionError show all
Defined in:
lib/claude_sdk/errors.rb

Overview

Raised when Claude Code is not found or not installed

Examples:

raise CLINotFoundError.new("Claude Code not found", cli_path: "/usr/local/bin/claude")

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message: "Claude Code not found", cli_path: nil) ⇒ CLINotFoundError

Returns a new instance of CLINotFoundError.

Parameters:

  • message (String) (defaults to: "Claude Code not found")

    the error message

  • cli_path (String, nil) (defaults to: nil)

    the path where Claude Code was expected



24
25
26
27
28
# File 'lib/claude_sdk/errors.rb', line 24

def initialize(message: "Claude Code not found", cli_path: nil)
  @cli_path = cli_path
  message = "#{message}: #{cli_path}" if cli_path
  super(message)
end

Instance Attribute Details

#cli_pathString? (readonly)

Returns the path where Claude Code was expected.

Returns:

  • (String, nil)

    the path where Claude Code was expected



20
21
22
# File 'lib/claude_sdk/errors.rb', line 20

def cli_path
  @cli_path
end