Exception: ResoWebApi::NetworkError

Inherits:
Error
  • Object
show all
Defined in:
lib/reso_web_api/errors.rb

Direct Known Subclasses

Errors::AccessDenied

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ NetworkError

Returns a new instance of NetworkError


7
8
9
10
11
12
# File 'lib/reso_web_api/errors.rb', line 7

def initialize(options = {})
  # Support the standard initializer for errors
  opts = options.is_a?(Hash) ? options : { message: options.to_s }
  @response = opts[:response]
  super(opts[:message])
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response


5
6
7
# File 'lib/reso_web_api/errors.rb', line 5

def response
  @response
end

Instance Method Details

#statusObject


14
15
16
# File 'lib/reso_web_api/errors.rb', line 14

def status
  response && response.status
end