Exception: Openwsman::Exception

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/wbem/wsman.rb

Overview

Capture Fault as Exception

Instance Method Summary collapse

Constructor Details

#initialize(fault) ⇒ Exception

Returns a new instance of Exception.



27
28
29
30
31
32
33
# File 'lib/wbem/wsman.rb', line 27

def initialize fault
  unless fault.is_a? Openwsman::Fault
    raise "#{fault} is not a fault" unless fault.fault?
    fault = Openwsman::Fault.new fault
  end
  @fault = fault
end

Instance Method Details

#to_sObject



34
35
36
37
38
# File 'lib/wbem/wsman.rb', line 34

def to_s
  "Fault code #{@fault.code}, subcode #{@fault.subcode}" +
  "\n\treason #{@fault.reason}" +
  "\n\tdetail #{@fault.detail}"
end