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.



30
31
32
33
34
35
36
37
38
# File 'lib/bobot/exceptions.rb', line 30

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']
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#fbtrace_idObject (readonly)

Returns the value of attribute fbtrace_id.



28
29
30
# File 'lib/bobot/exceptions.rb', line 28

def fbtrace_id
  @fbtrace_id
end

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

#subcodeObject (readonly)

Returns the value of attribute subcode.



25
26
27
# File 'lib/bobot/exceptions.rb', line 25

def subcode
  @subcode
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#user_msgObject (readonly)

Returns the value of attribute user_msg.



27
28
29
# File 'lib/bobot/exceptions.rb', line 27

def user_msg
  @user_msg
end

#user_titleObject (readonly)

Returns the value of attribute user_title.



26
27
28
# File 'lib/bobot/exceptions.rb', line 26

def user_title
  @user_title
end

Instance Method Details

#to_sObject



40
41
42
# File 'lib/bobot/exceptions.rb', line 40

def to_s
  message
end