Sha256: 80c1d950560ce7d415a8c03059f6b72ac31eb1b2b0921f001105ca641bdf2f7e

Contents?: true

Size: 742 Bytes

Versions: 49

Compression:

Stored size: 742 Bytes

Contents

# frozen_string_literal: true

module WPScan
  module Error
    # HTTP Error
    class HTTP < Standard
      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 Download < HTTP
      def to_s
        "Unable to get #{failure_details}"
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
wpscan-3.8.27 lib/wpscan/errors/http.rb
wpscan-3.8.26 lib/wpscan/errors/http.rb
wpscan-3.8.25 lib/wpscan/errors/http.rb
wpscan-3.8.24 lib/wpscan/errors/http.rb
wpscan-3.8.22 lib/wpscan/errors/http.rb
wpscan-3.8.21 lib/wpscan/errors/http.rb
wpscan-3.8.20 lib/wpscan/errors/http.rb
wpscan-3.8.19 lib/wpscan/errors/http.rb
wpscan-3.8.18 lib/wpscan/errors/http.rb
wpscan-3.8.17 lib/wpscan/errors/http.rb
wpscan-3.8.16 lib/wpscan/errors/http.rb
wpscan-3.8.15 lib/wpscan/errors/http.rb
wpscan-3.8.14 lib/wpscan/errors/http.rb
wpscan-3.8.13 lib/wpscan/errors/http.rb
wpscan-3.8.12 lib/wpscan/errors/http.rb
wpscan-3.8.11 lib/wpscan/errors/http.rb
wpscan-3.8.10 lib/wpscan/errors/http.rb
wpscan-3.8.9 lib/wpscan/errors/http.rb
wpscan-3.8.8 lib/wpscan/errors/http.rb
wpscan-3.8.7 lib/wpscan/errors/http.rb