lib/winrm/exceptions.rb in winrm-2.2.3 vs lib/winrm/exceptions.rb in winrm-2.3.0

- old
+ new

@@ -1,7 +1,5 @@ -# encoding: UTF-8 -# # Copyright 2010 Dan Wanek <dan.wanek@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -47,9 +45,23 @@ def initialize(fault_description, fault_code) @fault_description = fault_description @fault_code = fault_code super("[WSMAN ERROR CODE: #{fault_code}]: #{fault_description}") + end + end + + # A Fault returned in the SOAP response. The XML node contains Code, SubCode and Reason + class WinRMSoapFault < WinRMError + attr_reader :code + attr_reader :subcode + attr_reader :reason + + def initialize(code, subcode, reason) + @code = code + @subcode = subcode + @reason = reason + super("[SOAP ERROR CODE: #{code} (#{subcode})]: #{reason}") end end # A Fault returned in the SOAP response. The XML node is a MSFT_WmiError class WinRMWMIError < WinRMError