Exception: Fetcher::HttpError

Inherits:
Error
  • Object
show all
Defined in:
lib/fetcher/worker.rb

Overview

todo/check:

rename to HttpRequestError or similar??
use "common" error class - why? why not?

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ HttpError

Returns a new instance of HttpError.



16
17
18
# File 'lib/fetcher/worker.rb', line 16

def initialize( code, message )
  @code, @message = code, message
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



14
15
16
# File 'lib/fetcher/worker.rb', line 14

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



14
15
16
# File 'lib/fetcher/worker.rb', line 14

def message
  @message
end

Instance Method Details

#to_sObject



20
21
22
# File 'lib/fetcher/worker.rb', line 20

def to_s
  "HTTP request failed (NOK) => #{@code} #{@message}"
end