Exception: Facebook::Messenger::FacebookError
- Defined in:
- lib/facebook/messenger/error.rb
Overview
Base error class for Facebook API errors.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#fbtrace_id ⇒ Object
readonly
Returns the value of attribute fbtrace_id.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#subcode ⇒ Object
readonly
Returns the value of attribute subcode.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#user_msg ⇒ Object
readonly
Returns the value of attribute user_msg.
-
#user_title ⇒ Object
readonly
Returns the value of attribute user_title.
Instance Method Summary collapse
-
#initialize(error) ⇒ FacebookError
constructor
Constructor function.
-
#to_s ⇒ String
Function to convert the error into string.
Constructor Details
#initialize(error) ⇒ FacebookError
Constructor function.
21 22 23 24 25 26 27 28 29 |
# File 'lib/facebook/messenger/error.rb', line 21 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
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/facebook/messenger/error.rb', line 10 def code @code end |
#fbtrace_id ⇒ Object (readonly)
Returns the value of attribute fbtrace_id.
14 15 16 |
# File 'lib/facebook/messenger/error.rb', line 14 def fbtrace_id @fbtrace_id end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
8 9 10 |
# File 'lib/facebook/messenger/error.rb', line 8 def @message end |
#subcode ⇒ Object (readonly)
Returns the value of attribute subcode.
11 12 13 |
# File 'lib/facebook/messenger/error.rb', line 11 def subcode @subcode end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/facebook/messenger/error.rb', line 9 def type @type end |
#user_msg ⇒ Object (readonly)
Returns the value of attribute user_msg.
13 14 15 |
# File 'lib/facebook/messenger/error.rb', line 13 def user_msg @user_msg end |
#user_title ⇒ Object (readonly)
Returns the value of attribute user_title.
12 13 14 |
# File 'lib/facebook/messenger/error.rb', line 12 def user_title @user_title end |
Instance Method Details
#to_s ⇒ String
Function to convert the error into string.
39 40 41 |
# File 'lib/facebook/messenger/error.rb', line 39 def to_s "#{@message} (subcode: #{subcode})" end |