Exception: UrlReader::ReadError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/url_reader/read_error.rb

Constant Summary collapse

PageNotFound =
0
RequestTimeout =
1
InternalServerError =
2
UnidentifiedError =
3

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseError

msg

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

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/url_reader/read_error.rb', line 7

def type
  @type
end