Exception: ClaudeAgentSDK::CLIJSONDecodeError

Inherits:
ClaudeSDKError
  • Object
show all
Defined in:
lib/claude_agent_sdk/errors.rb

Overview

Raised when unable to decode JSON from CLI output

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line, original_error) ⇒ CLIJSONDecodeError

Returns a new instance of CLIJSONDecodeError.



45
46
47
48
49
# File 'lib/claude_agent_sdk/errors.rb', line 45

def initialize(line, original_error)
  @line = line
  @original_error = original_error
  super("Failed to decode JSON: #{line[0...100]}...")
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



43
44
45
# File 'lib/claude_agent_sdk/errors.rb', line 43

def line
  @line
end

#original_errorObject (readonly)

Returns the value of attribute original_error.



43
44
45
# File 'lib/claude_agent_sdk/errors.rb', line 43

def original_error
  @original_error
end