Exception: E2B::CommandExitError
- Defined in:
- lib/e2b/errors.rb
Overview
Error raised when a command exits with non-zero exit code
Instance Attribute Summary collapse
-
#command_error ⇒ String?
readonly
Error message from the process.
-
#exit_code ⇒ Integer
readonly
Process exit code.
-
#stderr ⇒ String
readonly
Command stderr output.
-
#stdout ⇒ String
readonly
Command stdout output.
Attributes inherited from E2BError
Instance Method Summary collapse
-
#initialize(stdout: "", stderr: "", exit_code: 1, error: nil) ⇒ CommandExitError
constructor
A new instance of CommandExitError.
- #success? ⇒ Boolean
Constructor Details
#initialize(stdout: "", stderr: "", exit_code: 1, error: nil) ⇒ CommandExitError
Returns a new instance of CommandExitError.
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/e2b/errors.rb', line 90 def initialize(stdout: "", stderr: "", exit_code: 1, error: nil) @stdout = stdout @stderr = stderr @exit_code = exit_code @command_error = error = "Command exited with code #{exit_code}" += ": #{error}" if error += "\nStderr: #{stderr}" if stderr && !stderr.empty? super() end |
Instance Attribute Details
#command_error ⇒ String? (readonly)
Error message from the process
83 84 85 |
# File 'lib/e2b/errors.rb', line 83 def command_error @command_error end |
#exit_code ⇒ Integer (readonly)
Process exit code
83 84 85 |
# File 'lib/e2b/errors.rb', line 83 def exit_code @exit_code end |
#stderr ⇒ String (readonly)
Command stderr output
83 84 85 |
# File 'lib/e2b/errors.rb', line 83 def stderr @stderr end |
#stdout ⇒ String (readonly)
Command stdout output
83 84 85 |
# File 'lib/e2b/errors.rb', line 83 def stdout @stdout end |
Instance Method Details
#success? ⇒ Boolean
101 102 103 |
# File 'lib/e2b/errors.rb', line 101 def success? false end |