Exception: SocialCount::TwitterApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/social_count/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, code) ⇒ TwitterApiError

Returns a new instance of TwitterApiError.



6
7
8
9
# File 'lib/social_count/error.rb', line 6

def initialize(msg, code)
  @code = code.is_a?(Array) ? code.join(", ") : code
  super(msg)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/social_count/error.rb', line 10

def to_s
  "Code(s): #{code}\nSee code explanations at https://dev.twitter.com/docs/error-codes-responses"
end