Exception: Bobot::FacebookError

Inherits:
Error
  • Object
show all
Defined in:
lib/bobot/exceptions.rb

Overview

Base error class for Facebook API errors.

Direct Known Subclasses

Commander::Error, SendError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ FacebookError

Returns a new instance of FacebookError.



25
26
27
28
29
30
31
32
33
34
# File 'lib/bobot/exceptions.rb', line 25

def initialize(error)
  @message = error['message']
  @type = error['type']
  @code = error['code']
  @subcode = error['error_subcode']
  @user_title = error['error_user_title']
  @user_msg = error['error_user_msg']
  @fbtrace_id = error['fbtrace_id']
  @extras = error['extras']
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



18
19
20
# File 'lib/bobot/exceptions.rb', line 18

def code
  @code
end

#extrasObject (readonly)

Returns the value of attribute extras.



23
24
25
# File 'lib/bobot/exceptions.rb', line 23

def extras
  @extras
end

#fbtrace_idObject (readonly)

Returns the value of attribute fbtrace_id.



22
23
24
# File 'lib/bobot/exceptions.rb', line 22

def fbtrace_id
  @fbtrace_id
end

#messageObject (readonly)

Returns the value of attribute message.



16
17
18
# File 'lib/bobot/exceptions.rb', line 16

def message
  @message
end

#subcodeObject (readonly)

Returns the value of attribute subcode.



19
20
21
# File 'lib/bobot/exceptions.rb', line 19

def subcode
  @subcode
end

#typeObject (readonly)

Returns the value of attribute type.



17
18
19
# File 'lib/bobot/exceptions.rb', line 17

def type
  @type
end

#user_msgObject (readonly)

Returns the value of attribute user_msg.



21
22
23
# File 'lib/bobot/exceptions.rb', line 21

def user_msg
  @user_msg
end

#user_titleObject (readonly)

Returns the value of attribute user_title.



20
21
22
# File 'lib/bobot/exceptions.rb', line 20

def user_title
  @user_title
end

Instance Method Details

#to_sObject



36
37
38
# File 'lib/bobot/exceptions.rb', line 36

def to_s
  message
end