Exception: VkApi::Error

Inherits:
Exception
  • Object
show all
Defined in:
lib/vk-api/error.rb

Direct Known Subclasses

ApiError, AuthError, BaseError

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Error

Returns a new instance of Error.



4
5
6
# File 'lib/vk-api/error.rb', line 4

def initialize(env)
  @env = env
end

Instance Method Details

#[](key) ⇒ Object



12
13
14
# File 'lib/vk-api/error.rb', line 12

def [](key)
  @env[key]
end

#to_sObject



8
9
10
# File 'lib/vk-api/error.rb', line 8

def to_s
  "#{@env[:error]}: #{@env[:description]}"
end