Exception: WPScan::HTTPError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/wpscan/errors/http.rb

Overview

HTTP Error

Direct Known Subclasses

DownloadError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HTTPError

Returns a new instance of HTTPError.

Parameters:

  • res (Typhoeus::Response)


7
8
9
# File 'lib/wpscan/errors/http.rb', line 7

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



4
5
6
# File 'lib/wpscan/errors/http.rb', line 4

def response
  @response
end

Instance Method Details

#failure_detailsObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/wpscan/errors/http.rb', line 11

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

#to_sObject



23
24
25
# File 'lib/wpscan/errors/http.rb', line 23

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