Exception: ClaudeCode::CLIJSONDecodeError
- Inherits:
-
ClaudeSDKError
- Object
- StandardError
- ClaudeSDKError
- ClaudeCode::CLIJSONDecodeError
- Defined in:
- lib/claude_code/errors.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#original_error ⇒ Object
readonly
Returns the value of attribute original_error.
Instance Method Summary collapse
-
#initialize(line = nil, original_error = nil) ⇒ CLIJSONDecodeError
constructor
A new instance of CLIJSONDecodeError.
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
#line ⇒ Object (readonly)
Returns the value of attribute line.
35 36 37 |
# File 'lib/claude_code/errors.rb', line 35 def line @line end |
#original_error ⇒ Object (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 |