Exception: Yahoo::SE::ResponseError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/yahoo-se/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ ResponseError

Returns a new instance of ResponseError.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/yahoo-se/exceptions.rb', line 5

def initialize(errors)
  case errors.class
  when Hash
    title = errors["Title"]
    message = errors["Message"]
    puts "#{title} : #{message}"
  when String
    puts errors
  else
    puts errors.to_s
  end
end