jwagener-oauth-active-resource 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 6
4
+ :patch: 7
@@ -36,7 +36,7 @@ module OAuthActiveResource
36
36
 
37
37
  def self.destroy
38
38
  name = self.model_name.split('::').last
39
- p self.parent.send :remove_const, name
39
+ self.parent.send :remove_const, name
40
40
  end
41
41
  end
42
42
 
@@ -11,9 +11,21 @@ module OAuthActiveResource
11
11
  request(:get, path, build_request_headers(headers, :get))
12
12
  end
13
13
 
14
- # make handle_response public
15
- def handle_response(*args)
16
- super(*args)
14
+ # make handle_response public and add error message from body if possible
15
+ def handle_response(response)
16
+ return super(response)
17
+ rescue ActiveResource::ClientError => exc
18
+ begin
19
+ # ugly code to insert the error_message into response
20
+ error_message = "#{format.decode response.body}"
21
+ if not error_message.nil? or error_message == ""
22
+ exc.response.instance_eval do ||
23
+ @message = error_message
24
+ end
25
+ end
26
+ ensure
27
+ raise exc
28
+ end
17
29
  end
18
30
 
19
31
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jwagener-oauth-active-resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Wagener
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-25 00:00:00 -07:00
12
+ date: 2009-05-28 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency