Exception: LinkedIn::Error

Inherits:
StandardError
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/linkedin/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_data = {}) ⇒ Error

Returns a new instance of Error.



8
9
10
11
12
13
14
# File 'lib/linkedin/error.rb', line 8

def initialize(error_data={})
  if hash = Hash.try_convert(error_data)
    self.request, self.response = hash[:request], hash[:response]
  end

  super (self.response && self.response.body['message']) || error_data
end

Instance Attribute Details

#requestObject

Returns the value of attribute request.



5
6
7
# File 'lib/linkedin/error.rb', line 5

def request
  @request
end

#responseObject

Returns the value of attribute response.



5
6
7
# File 'lib/linkedin/error.rb', line 5

def response
  @response
end