Class: Fog::Hyperv::Errors::PSError
- Inherits:
-
ServiceError
- Object
- Errors::Error
- ServiceError
- Fog::Hyperv::Errors::PSError
- Defined in:
- lib/fog/hyperv.rb
Instance Attribute Summary collapse
-
#exitcode ⇒ Object
readonly
Returns the value of attribute exitcode.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(output, info) ⇒ PSError
constructor
A new instance of PSError.
- #to_s ⇒ Object
Constructor Details
#initialize(output, info) ⇒ PSError
Returns a new instance of PSError.
32 33 34 35 36 37 38 39 |
# File 'lib/fog/hyperv.rb', line 32 def initialize(output, info) @stdout = output.stdout @stderr = output.stderr @exitcode = output.exitcode @info = info @message = @stderr.split("\n").first super @message end |
Instance Attribute Details
#exitcode ⇒ Object (readonly)
Returns the value of attribute exitcode.
30 31 32 |
# File 'lib/fog/hyperv.rb', line 30 def exitcode @exitcode end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
30 31 32 |
# File 'lib/fog/hyperv.rb', line 30 def info @info end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
30 31 32 |
# File 'lib/fog/hyperv.rb', line 30 def @message end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
30 31 32 |
# File 'lib/fog/hyperv.rb', line 30 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
30 31 32 |
# File 'lib/fog/hyperv.rb', line 30 def stdout @stdout end |
Instance Method Details
#to_s ⇒ Object
41 42 43 44 45 |
# File 'lib/fog/hyperv.rb', line 41 def to_s ret = [super] ret << info unless info.nil? || info.empty? ret.join "\n" end |