Class: Fog::Hyperv::Errors::PSError

Inherits:
ServiceError
  • Object
show all
Defined in:
lib/fog/hyperv.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#exitcodeObject (readonly)

Returns the value of attribute exitcode.



30
31
32
# File 'lib/fog/hyperv.rb', line 30

def exitcode
  @exitcode
end

#infoObject (readonly)

Returns the value of attribute info.



30
31
32
# File 'lib/fog/hyperv.rb', line 30

def info
  @info
end

#messageObject (readonly)

Returns the value of attribute message.



30
31
32
# File 'lib/fog/hyperv.rb', line 30

def message
  @message
end

#stderrObject (readonly)

Returns the value of attribute stderr.



30
31
32
# File 'lib/fog/hyperv.rb', line 30

def stderr
  @stderr
end

#stdoutObject (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_sObject



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