Exception: ClaudeSDK::CLIJSONDecodeError
- Defined in:
- lib/claude_sdk/errors.rb
Overview
Raised when unable to decode JSON from CLI output
Instance Attribute Summary collapse
-
#line ⇒ String
readonly
The line that failed to decode.
-
#original_error ⇒ Exception
readonly
The original JSON parsing error.
Instance Method Summary collapse
-
#initialize(line:, original_error:) ⇒ CLIJSONDecodeError
constructor
A new instance of CLIJSONDecodeError.
Constructor Details
#initialize(line:, original_error:) ⇒ CLIJSONDecodeError
Returns a new instance of CLIJSONDecodeError.
69 70 71 72 73 |
# File 'lib/claude_sdk/errors.rb', line 69 def initialize(line:, original_error:) @line = line @original_error = original_error super("Failed to decode JSON: #{line[0..99]}...") end |
Instance Attribute Details
#line ⇒ String (readonly)
Returns the line that failed to decode.
62 63 64 |
# File 'lib/claude_sdk/errors.rb', line 62 def line @line end |
#original_error ⇒ Exception (readonly)
Returns the original JSON parsing error.
65 66 67 |
# File 'lib/claude_sdk/errors.rb', line 65 def original_error @original_error end |