Exception: VirtualBox::Error
- Inherits:
-
StandardError
- Object
- StandardError
- VirtualBox::Error
- Defined in:
- lib/virtual_box/error.rb
Overview
Raised when the VirtualBox CLI returns a non-zero error code.
Instance Attribute Summary collapse
-
#exit_code ⇒ Integer
readonly
The exit code of the failed VirtualBox command.
-
#output ⇒ String
readonly
The combined stdout and stderr of the failed VirtualBox command.
Instance Method Summary collapse
-
#initialize(cli_result) ⇒ Error
constructor
Called by raise.
Constructor Details
#initialize(cli_result) ⇒ Error
Called by raise.
17 18 19 20 21 22 |
# File 'lib/virtual_box/error.rb', line 17 def initialize(cli_result) @exit_code = cli_result[:status] @output = cli_result[:output] super "VirtualBox CLI exited with code #{@exit_code}:\n#{@output}\n" end |
Instance Attribute Details
#exit_code ⇒ Integer (readonly)
The exit code of the failed VirtualBox command.
7 8 9 |
# File 'lib/virtual_box/error.rb', line 7 def exit_code @exit_code end |
#output ⇒ String (readonly)
The combined stdout and stderr of the failed VirtualBox command.
11 12 13 |
# File 'lib/virtual_box/error.rb', line 11 def output @output end |