fbauth 0.9.9.5 → 0.9.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README.mdown +4 -0
  2. data/lib/facebook_graph.rb +4 -4
  3. metadata +3 -3
data/README.mdown CHANGED
@@ -48,3 +48,7 @@ to these questions yet:
48
48
  - do we get a new one?
49
49
  - are we expected to stop functioning and redirect to a FB login?
50
50
 
51
+ Change Log
52
+ ==========
53
+
54
+ v0.9.9.6 - Raising info-rich exceptions when errors returned from Facebook on graph calls
@@ -17,11 +17,11 @@ class FacebookGraph
17
17
  http.use_ssl = (uri.scheme == "https")
18
18
  req = Net::HTTP::Get.new(uri.path)
19
19
  response = http.request(req)
20
- throw "Facebook error response #{response.code}" if response.code != 200
20
+ raise "Facebook error response #{response.code} - #{response.body}" unless response.code == '200'
21
21
  begin
22
22
  json = JSON.parse(response.body)
23
23
  rescue => e
24
- throw "Error parsing Facebook response: #{response.body}"
24
+ raise "Error parsing Facebook response: #{response.body}"
25
25
  end
26
26
  ensure
27
27
  http.finish if http.started?
@@ -42,11 +42,11 @@ class FacebookGraph
42
42
  req = Net::HTTP::Post.new(uri.path)
43
43
  req.set_form_data(options)
44
44
  response = http.request(req)
45
- throw "Facebook error response #{response.code}" if response.code != 200
45
+ raise "Facebook error response #{response.code} - #{response.body}" unless response.code == '200'
46
46
  begin
47
47
  json = JSON.parse(response.body)
48
48
  rescue => e
49
- throw "Error parsing Facebook response: #{response.body}"
49
+ raise "Error parsing Facebook response: #{response.body}"
50
50
  end
51
51
  ensure
52
52
  http.finish if http.started?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbauth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 41
4
+ hash: 47
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 9
10
- - 5
11
- version: 0.9.9.5
10
+ - 6
11
+ version: 0.9.9.6
12
12
  platform: ruby
13
13
  authors:
14
14
  - Three Wise Men Inc.