Exception: WPScan::Error::HTTP

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

Overview

HTTP Error

Direct Known Subclasses

Download

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HTTP

Returns a new instance of HTTP.

Parameters:



10
11
12
# File 'lib/wpscan/errors/http.rb', line 10

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end

Instance Method Details

#failure_detailsObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/wpscan/errors/http.rb', line 14

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



26
27
28
# File 'lib/wpscan/errors/http.rb', line 26

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