Sha256: 7177aee480b327bc75f4d6c8d9c32b9d5ff9e164aa65a702bf99827a99a5b115

Contents?: true

Size: 658 Bytes

Versions: 16

Compression:

Stored size: 658 Bytes

Contents

module WPScan
  # HTTP Error
  class HTTPError < StandardError
    attr_reader :response

    # @param [ Typhoeus::Response ] res
    def initialize(response)
      @response = response
    end

    def failure_details
      msg = response.effective_url

      msg += if response.code.zero? || response.timed_out?
               " (#{response.return_message})"
             else
               " (status: #{response.code})"
             end

      msg
    end

    def to_s
      "HTTP Error: #{failure_details}"
    end
  end

  # Used in the Updater
  class DownloadError < HTTPError
    def to_s
      "Unable to get #{failure_details}"
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
wpscan-3.3.3 lib/wpscan/errors/http.rb
wpscan-3.3.2 lib/wpscan/errors/http.rb
wpscan-3.3.1 lib/wpscan/errors/http.rb
wpscan-3.3.0 lib/wpscan/errors/http.rb
wpscan-3.2.1 lib/wpscan/errors/http.rb
wpscan-3.2.0 lib/wpscan/errors/http.rb
wpscan-3.1.0 lib/wpscan/errors/http.rb
wpscan-3.0.8 lib/wpscan/errors/http.rb
wpscan-3.0.7 lib/wpscan/errors/http.rb
wpscan-3.0.6 lib/wpscan/errors/http.rb
wpscan-3.0.5 lib/wpscan/errors/http.rb
wpscan-3.0.4 lib/wpscan/errors/http.rb
wpscan-3.0.3 lib/wpscan/errors/http.rb
wpscan-3.0.2 lib/wpscan/errors/http.rb
wpscan-3.0.1 lib/wpscan/errors/http.rb
wpscan-3.0 lib/wpscan/errors/http.rb