Exception: Vkontakte::API::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Vkontakte::API::Error
- Defined in:
- lib/vkontakte/api_error.rb
Overview
An exception raised by ‘Vkontakte::API` when given a response with an error
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_msg ⇒ Object
readonly
Returns the value of attribute error_msg.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(method_name, error_code, error_msg, params) ⇒ Error
constructor
A new instance of Error.
-
#message ⇒ Object
A full description of the error.
Constructor Details
#initialize(method_name, error_code, error_msg, params) ⇒ Error
Returns a new instance of Error.
9 10 11 12 13 14 |
# File 'lib/vkontakte/api_error.rb', line 9 def initialize(method_name, error_code, error_msg, params) @method_name = method_name @error_code = error_code.to_i @error_msg = error_msg @params = params end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
7 8 9 |
# File 'lib/vkontakte/api_error.rb', line 7 def error_code @error_code end |
#error_msg ⇒ Object (readonly)
Returns the value of attribute error_msg.
7 8 9 |
# File 'lib/vkontakte/api_error.rb', line 7 def error_msg @error_msg end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
7 8 9 |
# File 'lib/vkontakte/api_error.rb', line 7 def method_name @method_name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
7 8 9 |
# File 'lib/vkontakte/api_error.rb', line 7 def params @params end |
Instance Method Details
#message ⇒ Object
A full description of the error
17 18 19 |
# File 'lib/vkontakte/api_error.rb', line 17 def "VKontakte returned an error #{@error_code}: '#{@error_msg}' after calling method '#{@method_name}' with parameters #{@params.inspect}" end |