Exception: UrlReader::ReadError
- Defined in:
- lib/url_reader/read_error.rb
Constant Summary collapse
- PageNotFound =
0- RequestTimeout =
1- InternalServerError =
2- UnidentifiedError =
3
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(*args) ⇒ ReadError
constructor
A new instance of ReadError.
Methods inherited from BaseError
Constructor Details
#initialize(*args) ⇒ ReadError
Returns a new instance of ReadError.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/url_reader/read_error.rb', line 9 def initialize(*args) super(*args) inner = args[0] @type = if inner.is_a?(RestClient::ResourceNotFound) PageNotFound elsif inner.is_a?(RestClient::RequestTimeout) RequestTimeout elsif inner.is_a?(RestClient::InternalServerError) InternalServerError else UnidentifiedError end end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/url_reader/read_error.rb', line 7 def type @type end |