Exception: ClaudeSDK::ProcessError
- Defined in:
- lib/claude_sdk/errors.rb
Overview
Raised when the CLI process fails
Instance Attribute Summary collapse
-
#exit_code ⇒ Integer?
readonly
The process exit code.
-
#stderr ⇒ String?
readonly
The stderr output from the process.
Instance Method Summary collapse
-
#initialize(message, exit_code: nil, stderr: nil) ⇒ ProcessError
constructor
A new instance of ProcessError.
Constructor Details
#initialize(message, exit_code: nil, stderr: nil) ⇒ ProcessError
Returns a new instance of ProcessError.
45 46 47 48 49 50 51 52 53 |
# File 'lib/claude_sdk/errors.rb', line 45 def initialize(, exit_code: nil, stderr: nil) @exit_code = exit_code @stderr = stderr = "#{message} (exit code: #{exit_code})" if exit_code = "#{message}\nError output: #{stderr}" if stderr super() end |
Instance Attribute Details
#exit_code ⇒ Integer? (readonly)
Returns the process exit code.
37 38 39 |
# File 'lib/claude_sdk/errors.rb', line 37 def exit_code @exit_code end |
#stderr ⇒ String? (readonly)
Returns the stderr output from the process.
40 41 42 |
# File 'lib/claude_sdk/errors.rb', line 40 def stderr @stderr end |