Exception: SourceMonitor::Fetching::HTTPError

Inherits:
FetchError
  • Object
show all
Defined in:
lib/source_monitor/fetching/fetch_error.rb

Constant Summary collapse

CODE =
"http_error"

Instance Attribute Summary collapse

Attributes inherited from FetchError

#original_error, #response

Instance Method Summary collapse

Methods inherited from FetchError

#code, #http_status

Constructor Details

#initialize(status:, message: nil, response: nil, original_error: nil) ⇒ HTTPError

Returns a new instance of HTTPError.



56
57
58
59
# File 'lib/source_monitor/fetching/fetch_error.rb', line 56

def initialize(status:, message: nil, response: nil, original_error: nil)
  @status = status
  super(message || "HTTP #{status}", response: response, original_error: original_error)
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



54
55
56
# File 'lib/source_monitor/fetching/fetch_error.rb', line 54

def status
  @status
end