Exception: Fetcher::HttpError
- 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
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(code, message) ⇒ HttpError
constructor
A new instance of HttpError.
- #to_s ⇒ Object
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, ) @code, @message = code, end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
14 15 16 |
# File 'lib/fetcher/worker.rb', line 14 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
14 15 16 |
# File 'lib/fetcher/worker.rb', line 14 def @message end |
Instance Method Details
#to_s ⇒ Object
20 21 22 |
# File 'lib/fetcher/worker.rb', line 20 def to_s "HTTP request failed (NOK) => #{@code} #{@message}" end |