lib/vkontakte_api/error.rb in vkontakte_api-1.4.2 vs lib/vkontakte_api/error.rb in vkontakte_api-1.4.3
- old
+ new
@@ -2,17 +2,23 @@
# An exception raised by `VkontakteApi::Result` when given a response with an error.
class Error < StandardError
# An error code.
# @return [Fixnum]
attr_reader :error_code
+
# Captcha identifier (only for "Captcha needed" errors).
# @return [String]
attr_reader :captcha_sid
+
# Captcha image URL (only for "Captcha needed" errors).
# @return [String]
attr_reader :captcha_img
+ # Redirect URL (only for 17 errors).
+ # @return [String]
+ attr_reader :redirect_uri
+
# An exception is initialized by the data from response mash.
# @param [Hash] data Error data.
def initialize(data)
@error_code = data.error_code
@error_msg = data.error_msg
@@ -24,9 +30,10 @@
@oauth = request_params.delete('oauth')
@params = request_params
@captcha_sid = data.captcha_sid
@captcha_img = data.captcha_img
+ @redirect_uri = data.redirect_uri
end
# A full description of the error.
# @return [String]
def message