Exception: SourceMonitor::Fetching::FetchError
- Inherits:
-
StandardError
- Object
- StandardError
- SourceMonitor::Fetching::FetchError
- Defined in:
- lib/source_monitor/fetching/fetch_error.rb
Direct Known Subclasses
AuthenticationError, BlockedError, ConnectionError, HTTPError, ParsingError, TimeoutError, UnexpectedResponseError
Constant Summary collapse
- CODE =
"fetch_error"
Instance Attribute Summary collapse
-
#original_error ⇒ Object
readonly
Returns the value of attribute original_error.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #code ⇒ Object
- #http_status ⇒ Object
-
#initialize(message = nil, original_error: nil, response: nil) ⇒ FetchError
constructor
A new instance of FetchError.
Constructor Details
#initialize(message = nil, original_error: nil, response: nil) ⇒ FetchError
Returns a new instance of FetchError.
10 11 12 13 14 |
# File 'lib/source_monitor/fetching/fetch_error.rb', line 10 def initialize( = nil, original_error: nil, response: nil) super( || ) @original_error = original_error @response = response end |
Instance Attribute Details
#original_error ⇒ Object (readonly)
Returns the value of attribute original_error.
8 9 10 |
# File 'lib/source_monitor/fetching/fetch_error.rb', line 8 def original_error @original_error end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
8 9 10 |
# File 'lib/source_monitor/fetching/fetch_error.rb', line 8 def response @response end |
Instance Method Details
#code ⇒ Object
16 17 18 |
# File 'lib/source_monitor/fetching/fetch_error.rb', line 16 def code self.class::CODE end |
#http_status ⇒ Object
20 21 22 |
# File 'lib/source_monitor/fetching/fetch_error.rb', line 20 def http_status response&.status end |