Sha256: f9446d721522f274010752e6bc46984093054e3a12728db55a02ead7d9bd27c3

Contents?: true

Size: 1.69 KB

Versions: 26

Compression:

Stored size: 1.69 KB

Contents

# 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
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

module WinRM
  # WinRM base class for errors
  class WinRMError < StandardError; end

  # Authorization Error
  class WinRMAuthorizationError < WinRMError; end

  # A Fault returned in the SOAP response. The XML node is a WSManFault
  class WinRMWSManFault < WinRMError
    attr_reader :fault_code
    attr_reader :fault_description

    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 is a MSFT_WmiError
  class WinRMWMIError < WinRMError
    attr_reader :error_code
    attr_reader :error

    def initialize(error, error_code)
      @error = error
      @error_code = error_code
      super("[WMI ERROR CODE: #{error_code}]: #{error}")
    end
  end

  # non-200 response without a SOAP fault
  class WinRMHTTPTransportError < WinRMError
    attr_reader :status_code

    def initialize(msg, status_code)
      @status_code = status_code
      super(msg + " (#{status_code}).")
    end
  end
end

Version data entries

26 entries across 26 versions & 4 rubygems

Version Path
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/winrm-1.8.1/lib/winrm/exceptions/exceptions.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/gems/winrm-1.8.1/lib/winrm/exceptions/exceptions.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/gems/winrm-1.8.1/lib/winrm/exceptions/exceptions.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/gems/winrm-1.8.1/lib/winrm/exceptions/exceptions.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/gems/winrm-1.8.1/lib/winrm/exceptions/exceptions.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/winrm-1.8.1/lib/winrm/exceptions/exceptions.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/winrm-1.8.1/lib/winrm/exceptions/exceptions.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/winrm-1.8.1/lib/winrm/exceptions/exceptions.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/winrm-1.8.1/lib/winrm/exceptions/exceptions.rb
winrm-1.8.1 lib/winrm/exceptions/exceptions.rb
winrm-1.8.0 lib/winrm/exceptions/exceptions.rb
winrm-1.7.2 lib/winrm/exceptions/exceptions.rb
winrm-1.7.0 lib/winrm/exceptions/exceptions.rb
winrm-1.6.1 lib/winrm/exceptions/exceptions.rb
winrm-1.6.0 lib/winrm/exceptions/exceptions.rb
winrm-1.5.0 lib/winrm/exceptions/exceptions.rb
winrm-1.4.0 lib/winrm/exceptions/exceptions.rb
winrm-1.3.5 lib/winrm/exceptions/exceptions.rb
winrm-1.3.5.dev lib/winrm/exceptions/exceptions.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/winrm-1.3.4/lib/winrm/exceptions/exceptions.rb