Exception: ClaudeAgent::JSONDecodeError

Inherits:
Error
  • Object
show all
Defined in:
lib/claude_agent/errors.rb

Overview

Raised when JSON parsing fails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "Failed to decode JSON", raw_content: nil) ⇒ JSONDecodeError

Returns a new instance of JSONDecodeError.



53
54
55
56
57
58
# File 'lib/claude_agent/errors.rb', line 53

def initialize(message = "Failed to decode JSON", raw_content: nil)
  @raw_content = raw_content
  full_message = message
  full_message += "\nContent: #{raw_content[0..200]}..." if raw_content
  super(full_message)
end

Instance Attribute Details

#raw_contentObject (readonly)

Returns the value of attribute raw_content.



51
52
53
# File 'lib/claude_agent/errors.rb', line 51

def raw_content
  @raw_content
end