Method: FbGraph::Exception#initialize

Defined in:
lib/fb_graph/exception.rb

#initialize(code, message, body = '') ⇒ Exception

Returns a new instance of Exception.



81
82
83
84
85
86
87
88
89
# File 'lib/fb_graph/exception.rb', line 81

def initialize(code, message, body = '')
  @code = code
  if body.present?
    response = JSON.parse(body).with_indifferent_access
    message = response[:error][:message]
    @type = response[:error][:type]
  end
  super message
end