Exception: ClaudeCode::CLIJSONDecodeError

Inherits:
ClaudeSDKError show all
Defined in:
lib/claude_code/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line = nil, original_error = nil) ⇒ CLIJSONDecodeError

Returns a new instance of CLIJSONDecodeError.



37
38
39
40
41
42
43
44
45
46
# File 'lib/claude_code/errors.rb', line 37

def initialize(line = nil, original_error = nil)
  @line = line
  @original_error = original_error
  
  msg = "Failed to decode JSON"
  msg += ": #{line[0, 100]}..." if line && !line.empty?
  msg += " (#{original_error.message})" if original_error
  
  super(msg)
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



35
36
37
# File 'lib/claude_code/errors.rb', line 35

def line
  @line
end

#original_errorObject (readonly)

Returns the value of attribute original_error.



35
36
37
# File 'lib/claude_code/errors.rb', line 35

def original_error
  @original_error
end