yahoo-se 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,9 +3,16 @@ module Yahoo
3
3
  class ApplicationIDNotSet < RuntimeError; end
4
4
  class ResponseError < RuntimeError
5
5
  def initialize(errors)
6
- title = errors["Title"]
7
- message = errors["Message"]
8
- puts "#{title} : #{message}"
6
+ case errors.class
7
+ when Hash
8
+ title = errors["Title"]
9
+ message = errors["Message"]
10
+ puts "#{title} : #{message}"
11
+ when String
12
+ puts errors
13
+ else
14
+ puts errors.to_s
15
+ end
9
16
  end
10
17
  end
11
18
  end
@@ -30,7 +30,11 @@ module Yahoo
30
30
 
31
31
  # The response body of the request
32
32
  def response_body
33
- open(path,"User-Agent" => "Ruby/Yahoo Site Explorer Gem v#{Yahoo::SE::VERSION}").readlines.join
33
+ begin
34
+ @response_body = open(path,"User-Agent" => "Ruby/Yahoo Site Explorer Gem v#{Yahoo::SE::VERSION}").readlines.join
35
+ rescue OpenURI::HTTPError => @errors
36
+ raise ResponseError, @errors
37
+ end
34
38
  end
35
39
 
36
40
  # The results from the response object
@@ -1,5 +1,5 @@
1
1
  module Yahoo
2
2
  module SE
3
- VERSION = "1.0.8" unless defined?(Yahoo::SE::VERSION)
3
+ VERSION = "1.0.9" unless defined?(Yahoo::SE::VERSION)
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahoo-se
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lance Carlson